Beispiel #1
0
 public function isVisible()
 {
     try {
         ACLUser::checkCurrentUserGrants($this->rights);
     } catch (Exception $e) {
         return false;
     }
 }
Beispiel #2
0
 public function setTemplate($tplFile)
 {
     if (!ACLUser::hasUserRights([\CMSAuth::AdministratorRoleName])) {
         return;
     }
     if (file_exists(VIEW_PATH . $tplFile . '.tpl')) {
         $this->view->set('tplFile', \Extasy\CMS::getDashboardWWWRoot() . 'administrate/template-manager.php?tplFile=' . $tplFile);
     }
 }
Beispiel #3
0
 public function isVisible()
 {
     try {
         ACLUser::checkCurrentUserGrants($this->rights->getValue());
         return true;
     } catch (\Exception $e) {
         return false;
     }
 }
Beispiel #4
0
 /**
  *   Обновляет учетную запись
  * @return
  */
 public function update()
 {
     $granted = EventController::callFilter('users_account_before_update', true);
     // if granted then call standart update
     if ($granted) {
         $this->last_activity_date->setValue(date('Y-m-d H:i:s'));
         parent::update();
         EventController::callEvent('users_account_after_update');
         ACLUser::regenerateGuestCache($this);
     }
 }
Beispiel #5
0
 /**
  * @param $document
  */
 public static function isEditable($modelName)
 {
     $permissionName = self::getPermissionName($modelName);
     try {
         if (!empty($permissionName)) {
             ACLUser::checkCurrentUserGrants(array($permissionName));
         }
         return true;
     } catch (Exception $e) {
         return false;
     }
 }
Beispiel #6
0
 protected function checkACL()
 {
     if (!empty($this->requiredACLRights)) {
         try {
             ACLUser::checkCurrentUserGrants($this->requiredACLRights);
         } catch (Exception $e) {
             $errorMsg = sprintf('Failed to execute operation:%s. Current user - ', self::MethodName, UsersLogin::isLogined() ? sprintf('%s:%d', UsersLogin::getCurrentSession()->login->getValue(), UsersLogin::getCurrentSession()->id->getValue()) : '');
             Record::add('api', $errorMsg);
             throw $e;
         }
     }
 }
Beispiel #7
0
 protected function searchSitemap()
 {
     try {
         ACLUser::checkCurrentUserGrants([SitemapModel::PermissionName]);
         $items = \Sitemap_Sample::search($this->searchPhrase, 0, 10);
     } catch (\Exception $e) {
         $items = [];
     }
     foreach ($items as $row) {
         $isScript = !empty($row['script_admin_url']);
         $add = new SearchResultModel();
         $add->title = $row['name'];
         $add->icon = 'glyphicon glyphicon-user';
         //
         if (!$isScript) {
             $route = CMS::getInstance()->getDispatcher()->getNamed('dashboard.sitemap.manage');
             $add->link = $route->buildUrl() . '?id=' . $row['id'];
         } else {
             $add->link = sprintf('http://%s%s', CMS::getDashboardWWWRoot(), $row['script_admin_url']);
         }
         $this->results[] = $add;
     }
 }
Beispiel #8
0
 public function isVisible()
 {
     return ACLUser::hasUserRights([SitemapModel::PermissionName]);
 }
Beispiel #9
0
 public function process()
 {
     ACLUser::checkCurrentUserGrants($this->aclActionList);
     return parent::process();
 }