|
|||
|
Hi,
I've created a Zend_Acl object that is being generated from tables in a MySQL database. The problem is, when I query the Acl, i'm not getting the results that I expect. When I run Code:
if(!$this->_acl->isAllowed($this->_getRoleName(), $resourceName, $actionName)) {
//the user is not allowed access to this page... block access
throw new Zend_Exception("The role type '".$this->_getRoleName()."' is not allowed access to the resource '".$resourceName."' with action '".$actionName."'");
}
At this stage, the value of $this->_getRoleName() is 'Guest', the value of $resourceName is 'default_error' and the value of $actionName is 'error'. This is the exception that is throw... Code:
exception 'Zend_Exception' with message 'The role type 'Guest' is not allowed access to the resource 'default_error' with action 'error'' See below for the Acl... Code:
Zend_Acl Object
(
[_roleRegistry:protected] => Zend_Acl_Role_Registry Object
(
[_roles:protected] => Array
(
[Guest] => Array
(
[instance] => Zend_Acl_Role Object
(
[_roleId:protected] => Guest
)
[parents] => Array
(
)
[children] => Array
(
)
)
[Super Administrator] => Array
(
[instance] => Zend_Acl_Role Object
(
[_roleId:protected] => Super Administrator
)
[parents] => Array
(
)
[children] => Array
(
)
)
)
)
[_resources:protected] => Array
(
[default_error] => Array
(
[instance] => Zend_Acl_Resource Object
(
[_resourceId:protected] => default_error
)
[parent] =>
[children] => Array
(
)
)
[default_login] => Array
(
[instance] => Zend_Acl_Resource Object
(
[_resourceId:protected] => default_login
)
[parent] =>
[children] => Array
(
)
)
)
[_rules:protected] => Array
(
[allResources] => Array
(
[allRoles] => Array
(
[allPrivileges] => Array
(
[type] => TYPE_DENY
[assert] =>
)
[byPrivilegeId] => Array
(
)
)
[byRoleId] => Array
(
[Super Administrator] => Array
(
[byPrivilegeId] => Array
(
)
[allPrivileges] => Array
(
[type] => TYPE_ALLOW
[assert] =>
)
)
)
)
[byResourceId] => Array
(
[default_error] => Array
(
[byRoleId] => Array
(
[Guest] => Array
(
[byPrivilegeId] => Array
(
[] => Array
(
[type] => TYPE_ALLOW
[assert] =>
)
)
)
)
)
)
)
)
Last edited by DSmith : 05-08-2008 at 10:37 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|