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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-21-2008, 03:56 AM
Junior Member
 
Join Date: May 2008
Posts: 2
Default Zend ACL

Hi all,

I have the following code to setup some fairly simple ACL rules:
PHP Code:
$this->addRole( new Zend_Acl_Role('guest') )
     ->
addRole( new Zend_Acl_Role('unconfirmed'), 'guest' )
     ->
addRole( new Zend_Acl_Role('user'), 'unconfirmed' )
     ->
addRole( new Zend_Acl_Role('admin'), 'user' )
     ->
addRole( new Zend_Acl_Role('owner'), 'admin' )
     ->
addRole( new Zend_Acl_Role('god'), 'owner' );

$this->allow('guest'null, array('index''community''auth''register') )
     ->
allow('unconfirmed'nullnull)
     ->
allow('user'null'create')
     ->
allow('admin'null'admin')
     ->
allow('owner'nullnull)
     ->
allow('god'); 
When I query the ACL using the following, I get true, which is not what I expect.
PHP Code:
$authorized $this->isAllowed('user'null'admin');
echo (
$authorized) ? 'true' 'false'
Maybe I misunderstood something about Zend_ACL, but it seems like with the rules I have a 'user' should not be able to access the 'admin' resource. Am I doing something wrong?

Thanks for any help,
Daniel
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 04:23 AM.