当前位置: 首页>>代码示例>>PHP>>正文


PHP Manager::getPerms方法代码示例

本文整理汇总了PHP中Manager::getPerms方法的典型用法代码示例。如果您正苦于以下问题:PHP Manager::getPerms方法的具体用法?PHP Manager::getPerms怎么用?PHP Manager::getPerms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Manager的用法示例。


在下文中一共展示了Manager::getPerms方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: grid

 public function grid()
 {
     $idTransacao = $this->data->id ?: $this->data->idTransacao;
     $transacao = new Transacao($idTransacao);
     $this->data->array = $transacao->listGrupos()->asQuery()->getResult();
     $this->data->direitos = Manager::getPerms()->getPerms();
     $this->render("transacao/gridAcesso");
 }
开发者ID:joshuacoddingyou,项目名称:php,代码行数:8,代码来源:gridAcessoController.php

示例2: checkAccess

 public function checkAccess()
 {
     $result = true;
     $access = $this->getAccess();
     if ($access && Manager::isLogged()) {
         $perms = explode(':', $access);
         $right = Manager::getPerms()->getRight($perms[1]);
         $result = Manager::checkAccess($perms[0], $right);
     }
     return $result;
 }
开发者ID:joshuacoddingyou,项目名称:php,代码行数:11,代码来源:mcontrol.php

示例3: invokeHandler

 public function invokeHandler($m, $handler)
 {
     global $context, $module, $action, $item, $session, $page, $auth, $perms, $navbar, $theme, $history, $self, $url;
     if ($handler == '') {
         return false;
     }
     //$this->data = $data;
     $this->action = $handler;
     $app = Manager::getApp();
     if ($m == '' || $m == $app) {
         $module = $app;
         $path = Manager::getAppPath() . '/controllers/';
     } else {
         $module = $m;
         $path = Manager::getModulePath($module, 'controllers/');
     }
     //mdump("Handler:invokeHandler: [$module][$handler]");
     $context = Manager::getContext();
     $action = $context->getAction();
     $self = $context->getAction();
     $item = mrequest('item');
     $session = Manager::getSession();
     $navbar = new MNavigationBar();
     //$view = Manager::getView($module, 'handler', $action);
     $page = $this->theme;
     $url = Manager::getCurrentURL();
     $auth = Manager::getAuth();
     $perms = Manager::getPerms();
     $theme = $this->theme;
     $file = $path . $handler . '.inc.php';
     //mdump('Handler:invokeHandler: file : ' . $file);
     if ($return = file_exists($file)) {
         include $file;
     }
     return $return;
 }
开发者ID:joshuacoddingyou,项目名称:php,代码行数:36,代码来源:mhandler.php

示例4: formAcesso

 public function formAcesso()
 {
     $model = new Transacao($this->data->id);
     $this->data->object = $model->getData();
     $this->data->grupos = Grupo::create()->listAll()->asQuery()->getResult();
     $this->data->direitos = Manager::getPerms()->getPerms();
     $this->render();
 }
开发者ID:joshuacoddingyou,项目名称:php,代码行数:8,代码来源:transacaoController.php

示例5: isMemberOf

 public function isMemberOf($group)
 {
     return Manager::getPerms()->isMemberOf($group);
 }
开发者ID:joshuacoddingyou,项目名称:php,代码行数:4,代码来源:mlogin.php

示例6: handleChildren

 private function handleChildren($control, $node, $addMethod = 'addControl')
 {
     $context = $this->localContext;
     foreach ($node->children() as $i => $n) {
         if ($this->ignoreElement($n)) {
             continue;
         }
         $e = array();
         if ($i == 'event') {
             foreach ($n->attributes() as $property => $value) {
                 $e[$property] = trim(utf8_decode((string) $value));
             }
             $control->addEvent($e['event'], $e['handler'], $e['preventDefault'] === 'true');
         } elseif ($i == 'ajax') {
             foreach ($n->attributes() as $property => $value) {
                 $e[$property] = trim(utf8_decode((string) $value));
             }
             $url = $this->processValue($e['url']);
             $control->ajax($e['type'], $e['event'], $url, $e['load'], $e['preventDefault'] === 'true');
         } elseif ($i == 'data') {
             foreach ($n->attributes() as $property => $value) {
                 $e[$property] = trim(utf8_decode((string) $value));
             }
             if ($e['load']) {
                 $value = str_replace("\$this", "\$context", $e['load']);
                 $control->setData(eval('return ' . $value . ';'));
             }
             if ($e['id']) {
                 $id = $e['id'];
                 $control->data->{$id} = $this->processValue($e['value']);
             }
         } elseif ($i == 'property') {
             foreach ($n->attributes() as $property => $value) {
                 $control->{$property} = $this->processValue($value);
             }
         } elseif ($i == 'attribute') {
             foreach ($n->attributes() as $property => $value) {
                 $control->addAttribute($property, $this->processValue($value));
             }
         } elseif ($i == 'include') {
             $this->getControlsFromInclude($n, $control, true);
         } elseif ($i == 'fields') {
             $fields = $this->getControlsFromDOM($n);
             $control->addFields($fields);
         } elseif ($i == 'buttons') {
             $buttons = $this->getControlsFromDOM($n);
             $control->addButtons($buttons);
         } elseif ($i == 'auth') {
             foreach ($n->attributes() as $property => $value) {
                 $e[$property] = trim(utf8_decode((string) $value));
             }
             $perms = explode(':', $e['access']);
             $right = Manager::getPerms()->getRight($perms[1]);
             $ok = Manager::checkAccess($perms[0], $right);
             if ($ok) {
                 $this->handleChildren($control, $n, $addMethod);
             }
         } elseif ($i == 'help') {
             $fields = $this->getControlsFromDOM($n);
             $control->addFields($fields);
         } elseif ($i == 'validators') {
             $validators = $this->getControlsFromDOM($n);
             $control->setValidators($validators);
         } elseif ($i == 'controls') {
             $controls = $this->getControlsFromDOM($n);
             $control->setControls($controls);
         } elseif ($i == 'actions') {
             $controls = $this->getControlsFromDOM($n);
             $control->addAction($controls);
         } elseif ($i == 'action') {
             foreach ($n->attributes() as $property => $value) {
                 $e[$property] = $this->processValue($value);
             }
             $control->addAction($e['action'], $e['label'], $e['transaction'], $e['access']);
         } elseif ($i == 'tool') {
             foreach ($n->attributes() as $property => $value) {
                 $e[$property] = $this->processValue(trim(utf8_decode((string) $value)));
             }
             $control->addTool($e['title'], $e['action'], $e['icon']);
         } elseif ($i == 'method') {
             foreach ($n->attributes() as $property => $value) {
                 $e[$property] = trim(utf8_decode((string) $value));
             }
             $func = create_function($e['args'], trim(utf8_decode((string) $n[0])));
             $name = $e['name'];
             $control->{$name} = $func;
         } elseif ($i == 'css') {
             $this->handleNodeCSS($n);
         } elseif ($i == 'javascript') {
             $this->handleNodeJavascript($n);
         } else {
             $obj = $control->instance($i);
             if ($obj instanceof MValidator) {
                 $control->setValidator($obj);
             } else {
                 $obj->context = $control->context;
                 $this->getControlFromDOM($obj, $n);
                 $control->{$addMethod}($obj);
             }
         }
//.........这里部分代码省略.........
开发者ID:joshuacoddingyou,项目名称:php,代码行数:101,代码来源:mxmlcontrols.php


注:本文中的Manager::getPerms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。