修改AclManager,添加其它平台角色
This commit is contained in:
parent
47f3b3d828
commit
13e5e6be9b
|
@ -19,6 +19,17 @@ class AclManager extends \Zend_Controller_Plugin_Abstract
|
||||||
|
|
||||||
private $_adminRole;
|
private $_adminRole;
|
||||||
|
|
||||||
|
private $roles = array(
|
||||||
|
'系统管理员' => 'administrator',
|
||||||
|
'青海省气象科学研究所' => 'meteorologic',
|
||||||
|
'青海省环境监测中心站' => 'qhemc',
|
||||||
|
'青海省水土保持局' => 'watersoil',
|
||||||
|
'青海省林业调查规划院' => 'forestry',
|
||||||
|
'青海省水文水资源局' => 'hydrology',
|
||||||
|
'青海省草原总站' => 'grassland',
|
||||||
|
'青海省生态环境遥感监测中心' => 'qherc'
|
||||||
|
);
|
||||||
|
|
||||||
public function __construct(\Zend_Auth $auth)
|
public function __construct(\Zend_Auth $auth)
|
||||||
{
|
{
|
||||||
$config = \Zend_Registry::get('config');
|
$config = \Zend_Registry::get('config');
|
||||||
|
@ -30,7 +41,13 @@ class AclManager extends \Zend_Controller_Plugin_Abstract
|
||||||
// add the different user roles
|
// add the different user roles
|
||||||
$this->acl->addRole(new Zend_Acl_Role($this->_defaultRole));
|
$this->acl->addRole(new Zend_Acl_Role($this->_defaultRole));
|
||||||
$this->acl->addRole(new Zend_Acl_Role('member'));
|
$this->acl->addRole(new Zend_Acl_Role('member'));
|
||||||
$this->acl->addRole(new Zend_Acl_Role($this->_adminRole), 'member');
|
|
||||||
|
foreach($this->roles as $k=>$v)
|
||||||
|
{
|
||||||
|
$this->acl->addRole(new Zend_Acl_Role($v), 'member');
|
||||||
|
}
|
||||||
|
|
||||||
|
//$this->acl->addRole(new Zend_Acl_Role($this->_adminRole), 'member');
|
||||||
|
|
||||||
// add the resources we want to have control over
|
// add the resources we want to have control over
|
||||||
$this->acl->add(new Zend_Acl_Resource('account'));
|
$this->acl->add(new Zend_Acl_Resource('account'));
|
||||||
|
|
Loading…
Reference in New Issue