/**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return BOL_AuthorizationActionDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
 public function deleteActionById($actionId)
 {
     $actionId = (int) $actionId;
     if ($actionId > 0) {
         $this->permissionDao->deleteByActionId($actionId);
         $this->actionDao->deleteById($actionId);
     }
 }
Exemple #3
0
 public function onForumUninstall(OW_Event $event)
 {
     $config = OW::getConfig();
     if ($config->getValue('groups', 'is_forum_connected')) {
         $event = new OW_Event('forum.delete_section', array('entity' => 'groups'));
         OW::getEventManager()->trigger($event);
         $event = new OW_Event('forum.delete_widget');
         OW::getEventManager()->trigger($event);
         $config->saveConfig('groups', 'is_forum_connected', 0);
         $actionId = BOL_AuthorizationActionDao::getInstance()->getIdByName('add_topic');
         BOL_AuthorizationService::getInstance()->deleteAction($actionId);
     }
 }
Exemple #4
0
 private function isAuthorizedForRole()
 {
     $groupId = BOL_AuthorizationService::getInstance()->findGroupIdByName('photo');
     $photoAction = BOL_AuthorizationActionDao::getInstance()->findAction('view', $groupId);
     foreach (BOL_AuthorizationService::getInstance()->getRoleList() as $role) {
         if (BOL_AuthorizationPermissionDao::getInstance()->findByRoleIdAndActionId($role->id, $photoAction->id) !== null) {
             return true;
         }
     }
     return false;
 }