summaryrefslogtreecommitdiffstats
path: root/config/bootstrap/permissions.php
blob: c4fe982264f3706f38dfa0e28fb3ee758c5445c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
});
*/
?>