本文整理汇总了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);
}
示例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());
}
示例3: permissions
/**
* (non-PHPdoc)
* @see Page::permissions()
*/
public function permissions()
{
$this->addPermissao(ACL::all());
//Everybody
}
示例4: permissions
public function permissions()
{
$this->allow(ACL::all());
}