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
|
<?php
class My_Classe_Acl extends Zend_Acl
{
private $_role ;
public function __construct ($role)
{
$this->_role = $role;
$this->ajouterRole();
}
private function ajouterRole ()
{
$this->addRole(new Zend_Acl_Role('inactif'));
$this->addRole(new Zend_Acl_Role('annuaire'));
$this->addRole(new Zend_Acl_Role('introduction'), 'annuaire');
$this->addRole(new Zend_Acl_Role('administration'), 'introduction');
$this->addRole(new Zend_Acl_Role('organisation'), 'administration');
$this->allow('inactif', null, 'stop');
$this->allow('annuaire', NULL, 'annuaire');
$this->allow('introduction', NULL, array(
'annuaire' ,
'introduction'
));
$this->allow('administration', NULL, array(
'annuaire' ,
'introduction' ,
'administration'
));
$this->allow('organisation');
}
public function acces($access)
{
return $this->isAllowed($this->_role,NULL,$access);
}
} |