Skip to content

Middleware not working when using teams #187

@nikklass

Description

@nikklass

I have used laratrust to implemenet roles using the teams feature and now i wud like to group routes under a middleware. When i was not using teams i could do:

Route::group(['middleware' => 'role:superadministrator|administrator'], function() {
	... routes here....
});

and it wud work ok. But when i switched to using teams, it no longer works unless i add a team name at the end of the middleware filter. Like:

Route::group(['middleware' => 'role:superadministrator|administrator,team_name'], function() {
... routes here....
});

Is this how its supposed to work?

I wud like to leave the team_name out of my middleware filter since i have many dynamic teams and it wud be impossible to list them all in the middleware. I wud want to simply deny or allow access based on roles not roles in teams. Is that possible?

Rgds.
Nikk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions