在 Plone 的 Content Item 編輯畫面,可以看到 Sharing 頁籤,裡面的角色權限預設值是 Can add, Can edit, Can view, Can review,這樣的設定介面已存在多時。

在 Plone 4 環境,可以利用 GenericSetup 的檔案設定,在 Sharing 頁籤裡顯示新的角色權限,以 Manager 角色權限為例,在自製模組的 profiles/default 目錄裡,新增一個 sharing.xml 檔案:
<sharing xmlns:i18n="http://xml.zope.org/namespaces/i18n" i18n:domain="plone"> <!-- Adds a "Can manage" checkbox to Sharing tab --> <role id="Manager" title="Can manage" permission="Manage portal" i18n:attributes="title" /> </sharing>
重新安裝模組後,就可以看到效果。

更詳細的說明和範例,可以參考 http://plone.org/documentation/manual/developer-manual/generic-setup/reference/sharing-ref
No comments:
Post a Comment