forked from ivanamat/cakephp3-aclmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
94 lines (83 loc) · 2.42 KB
/
bootstrap.php
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* CakePHP 3.x - Acl Manager
*
* PHP version 5
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @category CakePHP3
*
* @author Ivan Amat <[email protected]>
* @copyright Copyright 2016, Iván Amat
* @license MIT http://opensource.org/licenses/MIT
* @link https://github.com/ivanamat/cakephp3-aclmanager
*
* @author Frédéric Massart - FMCorz.net
* @copyright Copyright 2011, Frédéric Massart
* @link http://github.com/FMCorz/AclManager
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
use Cake\Core\Configure;
/**
* List of AROs (Class aliases)
* Order is important! Parent to Children
*/
// Configure::write('AclManager.aros', array('Groups', 'Roles', 'Users'));
/**
* Limit used to paginate AROs
* Replace {alias} with ARO alias
* Configure::write('AclManager.{alias}.limit', 3)
*/
// Configure::write('AclManager.Role.limit', 3);
/**
* Routing Prefix
* Set the prefix you would like to restrict the plugin to
* @see Configure::read('Routing.prefixes')
*/
// Configure::write('AclManager.prefix', 'admin');
/**
* Ugly identation?
* Turn off when using CSS
*/
Configure::write('AclManager.uglyIdent', true);
/**
* Hide denied on ACL list
* Format: boolean ( true/false)
*/
if(!Configure::check('AclManager.hideDenied')) {
Configure::write('AclManager.hideDenied', true);
}
/**
* Actions to ignore when looking for new ACOs
* Format: 'action', 'Controller/action' or 'Plugin.Controller/action'
*/
if(!Configure::check('AclManager.ignoreActions')) {
Configure::write('AclManager.ignoreActions', array(
'isAuthorized',
'Acl.*',
'Error/*'
));
}
/**
* List of ARO models to load
* Use only if AclManager.aros aliases are different than model name
*/
// Configure::write('AclManager.models', array('Group', 'Customer'));
/**
* END OF USER SETTINGS
*/
/**
* AclManager settings
*/
Configure::write("AclManager.version", "1.3");
if (!is_array(Configure::read('AclManager.aros'))) {
Configure::write('AclManager.aros', array(Configure::read('AclManager.aros')));
}
if (!is_array(Configure::read('AclManager.ignoreActions'))) {
Configure::write('AclManager.ignoreActions', array(Configure::read('AclManager.ignoreActions')));
}
if (!Configure::read('AclManager.models')) {
Configure::write('AclManager.models', Configure::read('AclManager.aros'));
}