2009-12-18 12:56:12 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @copyright 2009 City of Bloomington, Indiana
|
2011-06-14 13:29:37 +00:00
|
|
|
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
|
2009-12-18 12:56:12 +00:00
|
|
|
* @author Cliff Ingham <inghamn@bloomington.in.gov>
|
|
|
|
*/
|
2014-08-18 20:17:49 +00:00
|
|
|
use Zend\Permissions\Acl\Acl;
|
|
|
|
use Zend\Permissions\Acl\Role\GenericRole as Role;
|
|
|
|
use Zend\Permissions\Acl\Resource\GenericResource as Resource;
|
|
|
|
|
|
|
|
$ZEND_ACL = new Acl();
|
|
|
|
$ZEND_ACL->addRole(new Role('Anonymous'))
|
|
|
|
->addRole(new Role('Public'), 'Anonymous')
|
|
|
|
->addRole(new Role('Staff'), 'Public')
|
|
|
|
->addRole(new Role('Administrator'), 'Staff');
|
2009-12-18 12:56:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Declare all the resources
|
|
|
|
*/
|
2014-08-18 20:17:49 +00:00
|
|
|
$ZEND_ACL->addResource(new Resource('index'));
|
|
|
|
$ZEND_ACL->addResource(new Resource('people'));
|
|
|
|
$ZEND_ACL->addResource(new Resource('users'));
|
|
|
|
$ZEND_ACL->addResource(new Resource('login'));
|
2009-12-18 12:56:12 +00:00
|
|
|
|
2014-08-18 20:17:49 +00:00
|
|
|
$ZEND_ACL->addResource(new Resource('deeds'));
|
|
|
|
$ZEND_ACL->addResource(new Resource('interments'));
|
|
|
|
$ZEND_ACL->addResource(new Resource('cemeteries'));
|
|
|
|
$ZEND_ACL->addResource(new Resource('sections'));
|
2009-12-18 12:56:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Assign permissions to the resources
|
|
|
|
*/
|
2014-08-18 20:17:49 +00:00
|
|
|
$ZEND_ACL->allow(null,'login');
|
|
|
|
|
|
|
|
// Permissions for unauthenticated browsing
|
|
|
|
$ZEND_ACL->allow(null,
|
|
|
|
array('index'),
|
|
|
|
array('index'));
|
|
|
|
|
|
|
|
// Allow Staff to do stuff
|
|
|
|
$ZEND_ACL->allow('Staff',['deeds', 'interments']);
|
|
|
|
$ZEND_ACL->allow('Staff',
|
|
|
|
['people', 'cemeteries', 'sections'],
|
|
|
|
['index','view']);
|
|
|
|
|
2009-12-18 12:56:12 +00:00
|
|
|
// Administrator is allowed access to everything
|
|
|
|
$ZEND_ACL->allow('Administrator');
|