forked from City-of-Bloomington/open311-sms
-
Notifications
You must be signed in to change notification settings - Fork 1
/
access_control.inc
44 lines (38 loc) · 1.33 KB
/
access_control.inc
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
<?php
/**
* @copyright 2012 City of Bloomington, Indiana
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
* @author Cliff Ingham <[email protected]>
*/
$ZEND_ACL = new Zend_Acl();
$ZEND_ACL->addRole(new Zend_Acl_Role('Anonymous'))
->addRole(new Zend_Acl_Role('Public'), 'Anonymous')
->addRole(new Zend_Acl_Role('Staff'), 'Public')
->addRole(new Zend_Acl_Role('Administrator'), 'Staff');
/**
* Declare all the resources
*/
$ZEND_ACL->add(new Zend_Acl_Resource('index'));
$ZEND_ACL->add(new Zend_Acl_Resource('people'));
$ZEND_ACL->add(new Zend_Acl_Resource('users'));
$ZEND_ACL->add(new Zend_Acl_Resource('login'));
$ZEND_ACL->add(new Zend_Acl_Resource('configuration'));
$ZEND_ACL->add(new Zend_Acl_Resource('simulator'));
$ZEND_ACL->add(new Zend_Acl_Resource('SMSinterface'));
$ZEND_ACL->add(new Zend_Acl_Resource('scheduledSMS'));
$ZEND_ACL->add(new Zend_Acl_Resource('scheduledSMSSimulator'));
/**
* Assign permissions to the resources
*/
$ZEND_ACL->allow(null,'login');
$ZEND_ACL->allow(null,'SMSinterface');
// Permissions for unauthenticated browsing
$ZEND_ACL->allow(null,
array('index'),
array('index'));
// Allow Staff to do stuff
$ZEND_ACL->allow('Staff',
array('people'),
array('index','view'));
// Administrator is allowed access to everything
$ZEND_ACL->allow('Administrator');