Interface Yiisoft\Rbac\RuleInterface
| Implemented by | Yiisoft\Rbac\CompositeRule |
|---|
The rule represents a business constraint that may be associated with a role or a permission.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| execute() | Executes the rule. | Yiisoft\Rbac\RuleInterface |
Method Details
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 |
| $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;
Signup or Login in order to comment.