Bristol SU Support Package
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser Class Reference

Public Member Functions

 __construct (Authentication $authentication)
 
 handle (Request $request, \Closure $next)
 

Private Member Functions

 checkUserIsInRole (User $user, Role $role)
 
 checkGroupBelongsToRole (Group $group, Role $role)
 
 checkUserHasMembershipToGroup (User $user, Group $group)
 
 checkGroupIsLoggedIn ()
 

Private Attributes

 $authentication
 

Detailed Description

Definition at line 12 of file CheckAdditionalCredentialsOwnedByUser.php.

Constructor & Destructor Documentation

◆ __construct()

BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser::__construct ( Authentication  $authentication)

Member Function Documentation

◆ checkGroupBelongsToRole()

BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser::checkGroupBelongsToRole ( Group  $group,
Role  $role 
)
private

Check that the role belongs to the given group

Parameters
Group$group
Role$role
Exceptions
IncorrectLoginIf the group does not belong to the role

Definition at line 71 of file CheckAdditionalCredentialsOwnedByUser.php.

Referenced by BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser\handle().

◆ checkGroupIsLoggedIn()

BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser::checkGroupIsLoggedIn ( )
private

Check a group is currently logged in

Exceptions
IncorrectLoginIf a group is not logged in

Definition at line 99 of file CheckAdditionalCredentialsOwnedByUser.php.

Referenced by BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser\handle().

◆ checkUserHasMembershipToGroup()

BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser::checkUserHasMembershipToGroup ( User  $user,
Group  $group 
)
private

Check that the user has a membership to the given group

Parameters
User$user
Group$group
Exceptions
IncorrectLoginIf the user does not have a membership to the group

Definition at line 85 of file CheckAdditionalCredentialsOwnedByUser.php.

Referenced by BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser\handle().

◆ checkUserIsInRole()

BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser::checkUserIsInRole ( User  $user,
Role  $role 
)
private

Check that the user is in the given role

Parameters
User$user
Role$role
Exceptions
IncorrectLoginIf the user does not belong to the role

Definition at line 55 of file CheckAdditionalCredentialsOwnedByUser.php.

Referenced by BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser\handle().

◆ handle()

BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser::handle ( Request  $request,
\Closure  $next 
)

Member Data Documentation

◆ $authentication

BristolSU\Support\Authorization\Middleware\CheckAdditionalCredentialsOwnedByUser::$authentication
private

The documentation for this class was generated from the following file: