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

Public Member Functions

 setNext (?Tester $tester=null)
 
 handle (Permission $permission, ?User $user, ?Group $group, ?Role $role)
 
 can (Permission $permission, ?User $user, ?Group $group, ?Role $role)
 

Private Attributes

 $successor = null
 

Detailed Description

Class to test a permission

Definition at line 15 of file Tester.php.

Member Function Documentation

◆ can()

BristolSU\Support\Permissions\Contracts\Tester::can ( Permission  $permission,
?User  $user,
?Group  $group,
?Role  $role 
)
abstract

Do the given models have the ability?

Parameters
Permission$permissionPermission to check
User | null$userUser to check the permission against
Group | null$groupGroup to check the permission against
Role | null$roleRole to check the permission against
Returns
bool|null Bool is the result of the permission check, or null if no result found.

Referenced by BristolSU\Support\Permissions\Contracts\Tester\handle().

◆ handle()

BristolSU\Support\Permissions\Contracts\Tester::handle ( Permission  $permission,
?User  $user,
?Group  $group,
?Role  $role 
)

Check if the tester has a result for the permission, or call the tester successor if not.

Parameters
Permission$permissionPermission to check
User | null$userUser to check if they have the permission
Group | null$groupGroup to check if they have the permission
Role | null$roleRole to check if they have the permission
Returns
bool|null Own result, or the result of the successor if own result is null

Definition at line 46 of file Tester.php.

References BristolSU\Support\Permissions\Contracts\Tester\can().

◆ setNext()

BristolSU\Support\Permissions\Contracts\Tester::setNext ( ?Tester  $tester = null)

Set the next tester in the chain

Parameters
Tester | null$testerNext tester

Definition at line 31 of file Tester.php.

Member Data Documentation

◆ $successor

BristolSU\Support\Permissions\Contracts\Tester::$successor = null
private

Definition at line 23 of file Tester.php.


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