コード例 #1
0
ファイル: cms.php プロジェクト: weareathlon/silla.io
 /**
  * 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]);
         }
     }
 }
コード例 #2
0
/**
 * 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);
}