Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-08-2008, 10:23 AM
Junior Member
 
Join Date: Mar 2008
Posts: 5
Default Acl not behaving as expected...

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."'");
		}
on the ACL, then the exception is thrown (which should happen only if the current role does not have access to the requested resource).

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''
Am I missing something glaringly obvious here? All help is appreciated!

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:48 AM.