diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/bootstrap.php | 2 | ||||
-rw-r--r-- | config/bootstrap/permissions.php | 35 | ||||
-rw-r--r-- | config/routes.php | 4 |
3 files changed, 36 insertions, 5 deletions
diff --git a/config/bootstrap.php b/config/bootstrap.php index 2a46046..1ced565 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -82,6 +82,6 @@ require __DIR__ . '/bootstrap/media.php'; */ // require __DIR__ . '/bootstrap/console.php'; -// require __DIR__ . '/bootstrap/permissions.php'; +require __DIR__ . '/bootstrap/permissions.php'; ?> diff --git a/config/bootstrap/permissions.php b/config/bootstrap/permissions.php new file mode 100644 index 0000000..c4fe982 --- /dev/null +++ b/config/bootstrap/permissions.php @@ -0,0 +1,35 @@ +<?php + +//Permissions stuff +/* +Access::config(array( + 'permissions' => array( + 'adapter' => 'Permissions', + 'model' => 'app\models\Perms', + 'defaultNoUser' => array(), + 'defaultUser' => array( + 'route' => array( + 'users' => array( + 'logout', 'account' + ) + ) + ), + 'userIdentifier' => 'PrincipalID' + ) +)); + +Perms::applyFilter('find', function($self, $params, $chain) { + if($params['type'] != 'first') { + return $chain->next($self, $params, $chain); + } + $cacheKey = 'permissions_' . $params['options']['conditions']['id']; + $cache = Cache::read('default', $cacheKey); + if($cache) { + return $cache; + } + $result = $chain->next($self, $params, $chain); + Cache::write('default', $cacheKey, $result, '+1 day'); + return $result; +}); +*/ +?>
\ No newline at end of file diff --git a/config/routes.php b/config/routes.php index 1da09b9..7ac2567 100644 --- a/config/routes.php +++ b/config/routes.php @@ -53,10 +53,6 @@ if (!Environment::is('production')) { Router::connect('/login', array('controller' => 'users', 'action' => 'login')); Router::connect('/logout', array('controller' => 'users', 'action' => 'logout')); -/* Content routes */ -//Router::connect('/anime', array('controller' => 'content', 'action' => 'anime')); -//Router::connect('/anime/{:args}', array('controller' => 'anime', 'action' => 'view')); - //Pagination route Router::connect('/{:controller}/{:action}/page:{:page:[0-9]+}'); |