yii\rbac\DbManager::checkAccess PHP Метод

checkAccess() публичный Метод

public checkAccess ( $userId, $permissionName, $params = [] )
    public function checkAccess($userId, $permissionName, $params = [])
    {
        $assignments = $this->getAssignments($userId);
        $this->loadFromCache();
        if ($this->items !== null) {
            return $this->checkAccessFromCache($userId, $permissionName, $params, $assignments);
        } else {
            return $this->checkAccessRecursive($userId, $permissionName, $params, $assignments);
        }
    }

Usage Example

Пример #1
0
 /**
  * @inheritdoc
  */
 public function checkAccess($userId, $permissionName, $params = [])
 {
     if (!isset($this->_users[$userId])) {
         $this->_users[$userId] = User::findOne($userId);
     }
     $user = $this->_users[$userId];
     if ($user instanceof User && $user->is_super_admin) {
         return true;
     } else {
         return parent::checkAccess($userId, $permissionName, $params);
     }
 }
All Usage Examples Of yii\rbac\DbManager::checkAccess