Class to test a permission
Definition at line 15 of file Tester.php.
◆ 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 | $permission | Permission to check |
User | null | $user | User to check the permission against |
Group | null | $group | Group to check the permission against |
Role | null | $role | Role 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 | $permission | Permission to check |
User | null | $user | User to check if they have the permission |
Group | null | $group | Group to check if they have the permission |
Role | null | $role | Role 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 | $tester | Next tester |
Definition at line 31 of file Tester.php.
◆ $successor
BristolSU\Support\Permissions\Contracts\Tester::$successor = null |
|
private |
The documentation for this class was generated from the following file: