我想提出以下基於Zend_Acl裏 Zend_Navigation導航是我的一塊navigation.xml文件位於/應用/ CONFIGS DIRZend的導航和遞歸的Zend的Acl
<?xml version="1.0" encoding="UTF-8"?>
<config>
<nav>
<menu1>
<label>solidData</label>
<uri>#</uri>
<pages>
<service>
<label>menuLabel1</label>
<controller>service</controller>
<action>index</action>
<resource>service</resource>
<privilege>index</privilege>
</service>
<attendance>
<label>menuLabel2</label>
<controller>attendance</controller>
<action>index</action>
<resource>attendance</resource>
<privilege>index</privilege>
</attendance>
</pages>
</menu1>
<menu2>
<label>systemData</label>
<uri>#</uri>
<pages>
<users>
<label>users</label>
<controller>users</controller>
<action>index</action>
<resource>users</resource>
<privilege>index</privilege>
</users>
<profile>
<label>profiles</label>
<controller>profile</controller>
<action>index</action>
<resource>profile</resource>
<privilege>index</privilege>
</profile>
<dictionary>
<label>dictionary</label>
<controller>dictionary</controller>
<action>index</action>
<resource>dictionary</resource>
<privilege>index</privilege>
</dictionary>
<language>
<label>languages</label>
<controller>language</controller>
<action>index</action>
<resource>language</resource>
<privilege>index</privilege>
</language>
</pages>
</menu2>
</nav>
</config>
我不想展示所有頁面在ACL中被拒絕的部分。
例如如果其在ACL中的<menu1>
所有網頁資源和特權我不想創建和TYPE_DENY用戶顯示標籤「solidData」
主要的問題是我的菜單結構,因爲當你看到我在一個菜單部分有各種資源。
我已經嘗試用功能ISVISIBLE()「和」 isActive()延長Zend_Navigation我自己的導航類「但我不能找到解決辦法。
我會任何幫助
感激[編輯]看看我的菜單的這個片段的結構:
<menu2>
<label>systemData</label>
<uri>#</uri>
<pages>
<users>
<label>users</label>
<controller>users</controller>
<action>index</action>
<resource>users</resource>
<privilege>index</privilege>
</users>
<profile>
<label>profiles</label>
<controller>profile</controller>
<action>index</action>
<resource>profile</resource>
<privilege>index</privilege>
</profile>
</pages>
</menu2>
我不能<resource>
到<menu2>
因爲<menu2>
包括具有不同資源f.e.的頁面。 '用戶'和'個人資料'。 也許有一些可能性添加許多資源到一個菜單。我嘗試類似的東西:
<menu2>
<label>systemData</label>
<uri>#</uri>
<resource>users</resource>
<resource>profile</resource>
<pages>
...
</pages>
</menu2>
,但我得到
Invalid argument: $resource must be null, a string, or an instance of Zend_Acl_Resource_Interface
編輯
好了,但如果我改變菜單的結構我也有改變ACL。 在我的ACL資源中,控制器的權限是控制器中的操作。
我同意,增加資源和特權''和限制訪問的ACL –
頁女巫的導航項目屬於有差異的資源,所以我不能任何資源添加到這不是一個解決方案 –
好的,但如果我改變菜單的結構,我還必須更改ACL。在我的ACL資源中,控制器的權限是控制器中的操作 –