From 05a2b26d9038752a40348a3f226e44710833c49b Mon Sep 17 00:00:00 2001 From: raylu Date: Sat, 2 Jul 2011 17:02:07 -0700 Subject: pull in dev branch changes not pulled: swiftmailer, gzip --- config/bootstrap/permissions.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 config/bootstrap/permissions.php (limited to 'config/bootstrap') 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 @@ + 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 -- cgit v1.2.3