i am using zend framework , in my site i have two types of users , guest and loggeduser , i have a controller called . books , in there i have 3 actions . add , edit and delete ,
in my zend acl i give the permissions to books controller only to logged user , in my navigation , books link is not shown to the guest , instead of that i want to show all 3 sublinks to logged user and , only add sub link to guest
like this
to loged user
books
add
edit
delete
and to guest
books
- add
the problem is when i set permissions in acl , the books link is completely not showing to the guest ,
this part of my acl
$this->addResource(new Zend_Acl_Resource('books'));
$this->addResource(new Zend_Acl_Resource('login'));
$this->addResource(new Zend_Acl_Resource('logout'));
$this->addRole(new Zend_Acl_Role('guest'));
$this->addRole(new Zend_Acl_Role('user'), 'guest');
$this->allow('guest', 'login');
$this->allow('user','logout');
$this->allow('user','books');
$this->deny('guest', 'logout');
$this->deny('user', 'login');
is there any way to set permission to action level or i need a plugin . i tried so hard to find a solution for hours , but couldn't . please help ............... thanks :(
UPDATE .
don't get confuced by the name , this is not the default zend Acl.php . this is a custom one stays in my models folder
part of my navigation.xml
<configdata>
<nav>
<books>
<label>Books</label>
<controller>books</controller>
<action>index</action>
<resource>books</resource>
<pages>
<add>
<label>Add</label>
<controller>books</controller>
<action>add</action>
</add>
<edit>
<label>Edit</label>
<controller>books</controller>
<action>edit</action>
</edit>
<delete>
<label>Delete</label>
<controller>books</controller>
<action>delete</action>
</delete>
</pages>
</books>
</nav>
</configdata>