Bristol SU Support Package
Public Member Functions | List of all members
BristolSU\Support\Permissions\Contracts\PermissionTester Interface Reference
Inheritance diagram for BristolSU\Support\Permissions\Contracts\PermissionTester:
Inheritance graph
[legend]

Public Member Functions

 evaluate (string $ability)
 
 evaluateFor (string $ability, ?User $userModel, ?Group $group, ?Role $role)
 
 register (Tester $tester)
 

Detailed Description

Test a permission

Definition at line 14 of file PermissionTester.php.

Member Function Documentation

◆ evaluate()

BristolSU\Support\Permissions\Contracts\PermissionTester::evaluate ( string  $ability)

Test if the currently authenticated user/group/role has the given ability

Parameters
string$abilityAbility of the permission
Returns
bool

Implemented in BristolSU\Support\Permissions\PermissionTester.

◆ evaluateFor()

BristolSU\Support\Permissions\Contracts\PermissionTester::evaluateFor ( string  $ability,
?User  $userModel,
?Group  $group,
?Role  $role 
)

Test if the given set of credentials have a given ability

Parameters
string$abilityAbility of the permission
User | null$userModelUser to test the permission against
Group | null$groupGroup to test the permission against
Role | null$roleRole to test the permission against
Returns
bool Do the given credentials have the permission?

◆ register()

BristolSU\Support\Permissions\Contracts\PermissionTester::register ( Tester  $tester)

Register a new permission tester

Parameters
Tester$testerImplementation of the permission tester
Returns
void

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