class App_Acl extends Zend_Acl
{
public function isAllowed($role = null, $resource = null, $privilege = null)
{
if (!$this->has($resource)) return false;
// reset role & resource to null
$this->_isAllowedRole = null;
$this->_isAllowedResource = null;
$this->_isAllowedPrivilege = null;
if (null !== $role) {
// keep track of originally called role
$this->_isAllowedRole = $role;
$role = $this->_getRoleRegistry()->get($role);
if (!$this->_isAllowedRole instanceof Zend_Acl_Role_Interface) {
$this->_isAllowedRole = $role;
}
}
if (null !== $resource) {
// keep track of originally called resource
$this->_isAllowedResource = $resource;
$resource = $this->get($resource);
if (!$this->_isAllowedResource instanceof Zend_Acl_Resource_Interface) {
$this->_isAllowedResource = $resource;
}
}
if (null === $privilege) {
// query on all privileges
do {
// depth-first search on $role if it is not 'allRoles' pseudo-parent
if (null !== $role && null !== ($result = $this->_roleDFSAllPrivileges($role, $resource, $privilege))) {
return $result;
}
// look for rule on 'allRoles' psuedo-parent
if (null !== ($rules = $this->_getRules($resource, null))) {
foreach ($rules['byPrivilegeId'] as $privilege => $rule) {
if (self::TYPE_DENY === ($ruleTypeOnePrivilege = $this->_getRuleType($resource, null, $privilege))) {
return false;
}
}
if (null !== ($ruleTypeAllPrivileges = $this->_getRuleType($resource, null, null))) {
return self::TYPE_ALLOW === $ruleTypeAllPrivileges;
}
}
// try next Resource
$resource = $this->_resources[$resource->getResourceId()]['parent'];
} while (true); // loop terminates at 'allResources' pseudo-parent
} else {
$this->_isAllowedPrivilege = $privilege;
// query on one privilege
do {
// depth-first search on $role if it is not 'allRoles' pseudo-parent
if (null !== $role && null !== ($result = $this->_roleDFSOnePrivilege($role, $resource, $privilege))) {
return $result;
}
// look for rule on 'allRoles' pseudo-parent
if (null !== ($ruleType = $this->_getRuleType($resource, null, $privilege))) {
return self::TYPE_ALLOW === $ruleType;
} else if (null !== ($ruleTypeAllPrivileges = $this->_getRuleType($resource, null, null))) {
return self::TYPE_ALLOW === $ruleTypeAllPrivileges;
}
// try next Resource
$resource = $this->_resources[$resource->getResourceId()]['parent'];
} while (true); // loop terminates at 'allResources' pseudo-parent
}
}
}
Fatal error: Uncaught Error: Class 'App_Acl' not found in /var/www/vhosts/jgnet.pl/httpdocs/stowarzyszenie.jgnet.pl/library/App/Plugin/Acl.php:8
Stack trace:
#0 /var/www/vhosts/jgnet.pl/httpdocs/stowarzyszenie.jgnet.pl/library/Zend/Controller/Plugin/Broker.php(309): App_Plugin_Acl->preDispatch(Object(Zend_Controller_Request_Http))
#1 /var/www/vhosts/jgnet.pl/httpdocs/stowarzyszenie.jgnet.pl/library/Zend/Controller/Front.php(941): Zend_Controller_Plugin_Broker->preDispatch(Object(Zend_Controller_Request_Http))
#2 /var/www/vhosts/jgnet.pl/httpdocs/stowarzyszenie.jgnet.pl/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#3 /var/www/vhosts/jgnet.pl/httpdocs/stowarzyszenie.jgnet.pl/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#4 /var/www/vhosts/jgnet.pl/httpdocs/stowarzyszenie.jgnet.pl/public/index.php(26): Zend_Application->run()
#5 {main}
thrown in /var/www/vhosts/jgnet.pl/httpdocs/stowarzyszenie.jgnet.pl/library/App/Plugin/Acl.php on line 8