yii\rbac\BaseManager::executeRule PHP Метод

executeRule() защищенный Метод

If the item does not specify a rule, this method will return true. Otherwise, it will return the value of [[Rule::execute()]].
protected executeRule ( string | integer $user, Item $item, array $params ) : boolean
$user string | integer the user ID. This should be either an integer or a string representing the unique identifier of a user. See [[\yii\web\User::id]].
$item Item the auth item that needs to execute its rule
$params array parameters passed to [[CheckAccessInterface::checkAccess()]] and will be passed to the rule
Результат boolean the return value of [[Rule::execute()]]. If the auth item does not specify a rule, true will be returned.
    protected function executeRule($user, $item, $params)
    {
        if ($item->ruleName === null) {
            return true;
        }
        $rule = $this->getRule($item->ruleName);
        if ($rule instanceof Rule) {
            return $rule->execute($user, $item, $params);
        } else {
            throw new InvalidConfigException("Rule not found: {$item->ruleName}");
        }
    }