Fixed and improved various issue in admin module (especially the Role editing which was not working as expected.)
Added CMS_MODULE.permissions to allow module to declare the potential permissions. Added support for CMS_LINK.is_forbidden, in relation with CMS_LOCAL_LINK.permission_arguments. Split link "username (Logout)" into 2 links "username" and "logout". Fixed/Changed the way auth modules alter the logout link based on "(Logout)" title, by safer solution based on `location' of the link. Fixed usage of WSF_REQUEST.path_info by using percent_encoded_path_info which is not non unicode path info to be used most of the time. Merged CMS_REPONSE.variables and CMS_REPONSE.values . When possible, prefer usage of CMS_RESPONSE.user instead of CMS_REQUEST_UTIL.current_user (WSF_REQUEST) whenever it is possible. When possible, prefer usage of CMS_RESPONSE.location, rather than usage of WSF_REQUEST.(percent_encoded_)path_info . Code cleaning.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
note
|
||||
description: "CMS module that bring support for NODE management."
|
||||
description: "CMS module bringing support for NODE management."
|
||||
date: "$Date: 2015-02-13 13:08:13 +0100 (ven., 13 févr. 2015) $"
|
||||
revision: "$Revision: 96616 $"
|
||||
|
||||
@@ -7,14 +7,14 @@ class
|
||||
CMS_NODE_MODULE
|
||||
|
||||
inherit
|
||||
|
||||
CMS_MODULE
|
||||
redefine
|
||||
register_hooks,
|
||||
initialize,
|
||||
is_installed,
|
||||
install,
|
||||
module_api
|
||||
module_api,
|
||||
permissions
|
||||
end
|
||||
|
||||
CMS_HOOK_MENU_SYSTEM_ALTER
|
||||
@@ -136,6 +136,34 @@ feature {CMS_API} -- Access: API
|
||||
node_api: detachable CMS_NODE_API
|
||||
-- <Precursor>
|
||||
|
||||
feature -- Access
|
||||
|
||||
permissions: LIST [READABLE_STRING_8]
|
||||
-- <Precursor>.
|
||||
do
|
||||
Result := Precursor
|
||||
Result.force ("create any")
|
||||
Result.force ("view any")
|
||||
Result.force ("edit any")
|
||||
Result.force ("delete any")
|
||||
Result.force ("view own")
|
||||
Result.force ("edit own")
|
||||
Result.force ("delete own")
|
||||
if attached node_api as l_node_api then
|
||||
across
|
||||
l_node_api.content_types as ic
|
||||
loop
|
||||
Result.force ("create " + ic.item.name)
|
||||
Result.force ("view " + ic.item.name)
|
||||
Result.force ("edit " + ic.item.name)
|
||||
Result.force ("delete " + ic.item.name)
|
||||
Result.force ("view own " + ic.item.name)
|
||||
Result.force ("edit own " + ic.item.name)
|
||||
Result.force ("delete own " + ic.item.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
feature -- Access: router
|
||||
|
||||
setup_router (a_router: WSF_ROUTER; a_api: CMS_API)
|
||||
@@ -213,7 +241,7 @@ feature -- Hooks
|
||||
local
|
||||
lnk: CMS_LOCAL_LINK
|
||||
do
|
||||
debug
|
||||
debug
|
||||
create lnk.make ("List of nodes", "nodes")
|
||||
a_menu_system.primary_menu.extend (lnk)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user