Méthode |
Description |
|
__construct ( boolean $behavior, string $action, string | mixed $resource, Closure | null $condition = null ) |
Rule constructor |
|
addCondition ( Closure $condition ) : void |
Add a condition for the rule to check against |
|
getAction ( ) : string |
Returns action this rule represents |
|
getBehavior ( ) : boolean |
Returns whether rule is a privilege or a restriction |
|
getResource ( ) : mixed |
Returns resource this rule represents |
|
isAllowed ( ) : boolean |
Determine if current rule allows access |
|
isPrivilege ( ) : boolean |
Determine if rule is a privilege |
|
isRelevant ( string $action, string | mixed $resource ) : boolean |
Determine if current rule is relevant based on an action and resource |
|
isRestriction ( ) : boolean |
Determine if rule is a restriction |
|
matchesAction ( string $action ) : boolean |
Determine if the instance's action matches the one passed in |
|
matchesResource ( string | mixed $resource ) : boolean |
Determine if the instance's resource matches the one passed in |
|
setAction ( string $action ) : void |
Set instance action |
|
setBehavior ( boolean $behavior ) : void |
Set instance behavior |
|
setResource ( string | mixed $resource ) : void |
Set instance resource |
|
when ( $condition ) : void |
API friendly alias for addCondition |
|