35 if($user = $this->authentication->getUser()) {
36 if($role = $this->authentication->getRole()) {
40 } elseif($group = $this->authentication->getGroup()) {
45 return $next($request);
57 if(!in_array($role->id(), $user->roles()->map(
function(Role $role) {
73 if($group->id() !== $role->groupId()) {
74 throw new IncorrectLogin(
'The group must belong to the current role');
87 if(!in_array($group->id(), $user->groups()->map(
function(Group $group) {
90 throw new IncorrectLogin(
'The user must have a membership to the group');
101 if($group = $this->authentication->getGroup()) {
104 throw new IncorrectLogin(
'The group must belong to the current role');
checkUserIsInRole(User $user, Role $role)
__construct(Authentication $authentication)
checkGroupBelongsToRole(Group $group, Role $role)
handle(Request $request, \Closure $next)
checkUserHasMembershipToGroup(User $user, Group $group)