0 follower

Interface Yiisoft\Rbac\RuleInterface

Implemented byYiisoft\Rbac\CompositeRule

The rule represents a business constraint that may be associated with a role or a permission.

Public Methods

Hide inherited methods

Method Description Defined By
execute() Executes the rule. Yiisoft\Rbac\RuleInterface

Method Details

Hide inherited methods

execute() public abstract method

Executes the rule.

public abstract boolean execute ( string|null $userId, Yiisoft\Rbac\Item $item, Yiisoft\Rbac\RuleContext $context )
$userId string|null

The user ID. This should be a string representing the unique identifier of a user. For guests the value is null.

$item Yiisoft\Rbac\Item

The role or permission that this rule is associated with.

$context Yiisoft\Rbac\RuleContext

Rule context.

return boolean

Whether the rule permits the auth item, it is associated with.

                public function execute(?string $userId, Item $item, RuleContext $context): bool;