Skip to content
Newer
Older
100644 47 lines (38 sloc) 1.32 KB
f826e17 @inghamn Initial Import
inghamn authored Feb 27, 2012
1 <?php
2 /**
90641dd @inghamn Updated to the the viewmodel style of blossom
inghamn authored Apr 29, 2016
3 * @copyright 2012-2014 City of Bloomington, Indiana
f826e17 @inghamn Initial Import
inghamn authored Feb 27, 2012
4 * @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
5 * @author Cliff Ingham <inghamn@bloomington.in.gov>
6 */
90641dd @inghamn Updated to the the viewmodel style of blossom
inghamn authored Apr 29, 2016
7 use Zend\Permissions\Acl\Acl;
8 use Zend\Permissions\Acl\Role\GenericRole as Role;
9 use Zend\Permissions\Acl\Resource\GenericResource as Resource;
10
11 $ZEND_ACL = new Acl();
12 $ZEND_ACL->addRole(new Role('Anonymous'))
13 ->addRole(new Role('Public'), 'Anonymous')
14 ->addRole(new Role('Staff'), 'Public')
15 ->addRole(new Role('Administrator'), 'Staff');
f826e17 @inghamn Initial Import
inghamn authored Feb 27, 2012
16
17 /**
18 * Declare all the resources
19 */
90641dd @inghamn Updated to the the viewmodel style of blossom
inghamn authored Apr 29, 2016
20 $ZEND_ACL->addResource(new Resource('index'));
21 $ZEND_ACL->addResource(new Resource('people'));
22 $ZEND_ACL->addResource(new Resource('users'));
23 $ZEND_ACL->addResource(new Resource('login'));
f826e17 @inghamn Initial Import
inghamn authored Feb 27, 2012
24
90641dd @inghamn Updated to the the viewmodel style of blossom
inghamn authored Apr 29, 2016
25 $ZEND_ACL->addResource(new Resource('endpoints'));
26 $ZEND_ACL->addResource(new Resource('clients'));
27 $ZEND_ACL->addResource(new Resource('embed'));
f826e17 @inghamn Initial Import
inghamn authored Feb 27, 2012
28
29 /**
30 * Assign permissions to the resources
31 */
90641dd @inghamn Updated to the the viewmodel style of blossom
inghamn authored Apr 29, 2016
32 $ZEND_ACL->allow(null,['login', 'embed']);
f826e17 @inghamn Initial Import
inghamn authored Feb 27, 2012
33
34 // Permissions for unauthenticated browsing
35 $ZEND_ACL->allow(null,
90641dd @inghamn Updated to the the viewmodel style of blossom
inghamn authored Apr 29, 2016
36 ['index'],
37 ['index']);
f826e17 @inghamn Initial Import
inghamn authored Feb 27, 2012
38
39 // Allow Staff to do stuff
40 $ZEND_ACL->allow('Staff',
90641dd @inghamn Updated to the the viewmodel style of blossom
inghamn authored Apr 29, 2016
41 ['people', 'endpoints', 'clients'],
42 ['index','view']);
43
f826e17 @inghamn Initial Import
inghamn authored Feb 27, 2012
44
45 // Administrator is allowed access to everything
46 $ZEND_ACL->allow('Administrator');
Something went wrong with that request. Please try again.