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


PHP ACL::all方法代码示例

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


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

示例1: action_user

 public function action_user()
 {
     $id = (int) $this->request->param('id', 0);
     $post = ORM::factory('user', $id);
     if (!$post->loaded() or $id === 1) {
         Message::error(__("User doesn't exists!"));
         Log::error('Attempt to access non-existent user.');
         $this->request->redirect(Route::get('admin/user')->uri(array('action' => 'list')), 404);
     }
     $this->title = __(':user Permissions', array(":user" => $post->name));
     $action = Route::get('admin/permission')->uri(array('action' => 'user', 'id' => isset($post->id) ? $post->id : 0));
     $view = View::factory('admin/permission/user')->set('post', $post)->set('oldperms', $post->perms())->set('permissions', ACL::all())->set('action', $action)->bind('errors', $this->_errors);
     if ($this->valid_post('permissions')) {
         $perms = array_filter($_POST['perms']);
         $post->data = array('permissions' => $perms);
         try {
             $post->save();
             Message::success(__('Permissions: saved successful!'));
             $this->request->redirect(Route::get('admin/permission')->uri(array('action' => 'user', 'id' => $post->id)));
         } catch (ORM_Validation_Exception $e) {
             Message::error(__('Permissions save failed!'));
             $this->_errors = $e->errors('models', TRUE);
         } catch (Exception $e) {
             Message::error(__('Permissions save failed!'));
             $this->_errors = array($e->getMessage());
         }
     }
     $this->response->body($view);
 }
开发者ID:MenZil-Team,项目名称:cms,代码行数:29,代码来源:permission.php

示例2: test_cache_stores_route_objects

 /**
  * If Route::cache() was able to restore routes from the cache then
  * it should return TRUE and load the cached routes
  *
  * @test
  * @covers Route::cache
  */
 public function test_cache_stores_route_objects()
 {
     $acls = ACL::all();
     // First we create the cache
     ACL::cache(TRUE);
     // Now lets modify the "current" routes
     ACL::set('contact', array('sending mail' => array('title' => __('Sending Mails'), 'restrict access' => FALSE, 'description' => __('Ability to send messages for administrators from your site'))));
     // Then try and load said cache
     $this->assertTrue(ACL::cache());
     // Check the route cache flag
     $this->assertTrue(ACL::$cache);
     // And if all went ok the nonsensical route should be gone...
     $this->assertEquals($acls, ACL::all());
 }
开发者ID:MenZil-Team,项目名称:cms,代码行数:21,代码来源:AclTest.php

示例3: permissions

 /**
  * (non-PHPdoc)
  * @see Page::permissions()
  */
 public function permissions()
 {
     $this->addPermissao(ACL::all());
     //Everybody
 }
开发者ID:vagnerbarros,项目名称:anphpf,代码行数:9,代码来源:CadastrarPessoaPage.php

示例4: permissions

 public function permissions()
 {
     $this->allow(ACL::all());
 }
开发者ID:vagnerbarros,项目名称:anphpf,代码行数:4,代码来源:RemoverMensagemAction.php


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