示例#1
0
 /**
  * {@inheritdoc}
  */
 public function checkPermissions(IComponent $component, $resource, $operationName = IAclManager::OPERATION_ALL)
 {
     $authManager = $this->getDefaultAuthManager();
     if (!$authManager->isAuthenticated()) {
         return false;
     }
     $identity = $authManager->getStorage()->getIdentity();
     if (!$identity instanceof IComponentRoleResolver) {
         return false;
     }
     $roleProvider = new ComponentRoleProvider($component, $identity);
     $aclManager = $component->getAclManager();
     return $aclManager->isAllowed($roleProvider, $resource, $operationName);
 }