Property | Type | Description | |
---|---|---|---|
$aliasedActions |
Method | Description | |
---|---|---|
__construct ( mixed $currentUser, mixed $dispatcher = null ) | Authority constructor | |
addAlias ( string $name, string | array $actions ) : RuleAlias | Define new alias for an action | |
addRule ( boolean $allow, string | array $actions, mixed $resources, Closure | null $condition = null ) : array | Define rule(s) for a given action(s) and resource(s) | |
addRules ( $allow, $actions, $resources, $condition = null ) | alias of addRule() | |
authorize ( $action, $resource, $args = null ) | ||
can ( $action, $resource, $resourceValue = null ) : boolean | Determine if current user can access the given action and resource | |
clearAliasedActions ( ) | Removes previously aliased actions including the defaults. | |
getAliases ( ) : array | Returns an associative array of aliases. | |
getAliasesForAction ( $action ) | This does the opposite kind of lookup as 'getExpandActions()'. | |
getExpandActions ( $actions ) | rely on the actions to be expanded. | |
getRelevantConditions ( string | array $action, string | object $resource ) : array | ||
getRulesFor ( $action, $resource ) : RuleRepository | Returns all rules relevant to the given action and resource | |
getUnauthorizedMessage ( $action, $subject ) | ||
hasCondition ( string | array $action, string | object $resource ) : boolean |
Method | Description | |
---|---|---|
addAliasAction ( $target, $actions ) | ||
getAliasedActions ( ) | The key is the target and the value is an array of actions aliasing the key. | |
getDefaultAliasActions ( ) | ||
getUnauthorizedMessageKeys ( $action, $subject ) | ||
initDefaultAliases ( ) | ||
validateTarget ( $target ) | User shouldn't specify targets with names of real actions or it will cause Seg fault |
public __construct ( mixed $currentUser, mixed $dispatcher = null ) | ||
$currentUser | mixed | Current user in the application |
$dispatcher | mixed | Dispatcher used for firing events |
public addRule ( boolean $allow, string | array $actions, mixed $resources, Closure | null $condition = null ) : array | ||
$allow | boolean | True if privilege, false if restriction |
$actions | string | array | Action(s) for the rule(s) |
$resources | mixed | Resource(s) for the rule(s) |
$condition | Closure | null | Optional condition for the rule |
return | array |
public addRules ( $allow, $actions, $resources, $condition = null ) |
public clearAliasedActions ( ) |
protected getAliasedActions ( ) |
public getAliases ( ) : array | ||
return | array |
public getAliasesForAction ( $action ) |
public getExpandActions ( $actions ) |
public getRulesFor ( $action, $resource ) : RuleRepository | ||
return | RuleRepository |
protected getUnauthorizedMessageKeys ( $action, $subject ) |
protected validateTarget ( $target ) |