/** * Loads CMS accessibility scope. * * @see \CMS\Helpers\CMSUsers::userCan() * * @return void */ protected function loadAccessibilityScope() { $this->modules = array_keys($this->labels['modules']); foreach ($this->modules as $key => $module) { if (!Helpers\CMSUsers::userCan(array('controller' => $module, 'action' => 'index'))) { unset($this->modules[$key]); } } }
/** * User can access a specific content helper to use in templates. * * @param array $options Options example [controller => '', action => '']. * @param Smarty_Internal_Template $template Template engine object. * * @uses \Core\Helpers\CMSUsers * * @return string */ function smarty_function_user_can(array $options, Smarty_Internal_Template $template) { return \CMS\Helpers\CMSUsers::userCan($options); }