public function isVisible() { try { ACLUser::checkCurrentUserGrants($this->rights); } catch (Exception $e) { return false; } }
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); } }
public function isVisible() { try { ACLUser::checkCurrentUserGrants($this->rights->getValue()); return true; } catch (\Exception $e) { return false; } }
/** * Обновляет учетную запись * @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); } }
/** * @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; } }
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; } } }
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; } }
public function isVisible() { return ACLUser::hasUserRights([SitemapModel::PermissionName]); }
public function process() { ACLUser::checkCurrentUserGrants($this->aclActionList); return parent::process(); }