Implemented CMS storage for user and nodes.

Implemented role and permission storage.
Introduced the CMS_PARTIAL_NODE and CMS_PARTIAL_USER.
Added support for node storage extension
  - storage of data specific to each node content type,
  - in addition to the core CMS_NODE)
  - For now, only implemented for SQL storage.
Note: in current version, CMS_PAGE support is hard coded in the core,
    (as opposed to be only supported by the node module.)
Commented/removed for now, the Web API code to update node summary, title, via REST request.
This commit is contained in:
2015-04-14 11:25:02 +02:00
parent 734f661add
commit 133c243126
46 changed files with 2262 additions and 468 deletions

View File

@@ -32,6 +32,8 @@ feature {NONE} -- Initialize
initialize
-- Initialize the persitent layer.
local
l_module: CMS_MODULE
do
to_implement ("Refactor database setup")
if attached setup.storage (error_handler) as l_storage then
@@ -39,6 +41,17 @@ feature {NONE} -- Initialize
else
create {CMS_STORAGE_NULL} storage
end
storage.set_api (Current)
across
setup.enabled_modules as ic
loop
l_module := ic.item
if not l_module.is_installed (Current) then
l_module.install (Current)
end
l_module.initialize (Current)
end
end
feature -- Access
@@ -50,7 +63,14 @@ feature -- Access
-- Logger
storage: CMS_STORAGE
-- Default persistence storage.
-- Default persistence storage.
feature -- Formats
formats: CMS_FORMATS
once
create Result
end
feature -- Status Report
@@ -66,6 +86,15 @@ feature -- Status Report
Result := error_handler.as_string_representation
end
feature -- Permissions system
user_has_permission (a_user: detachable CMS_USER; a_permission: detachable READABLE_STRING_GENERAL): BOOLEAN
-- Anonymous or user `a_user' has permission for `a_permission'?
--| `a_permission' could be for instance "create page".
do
Result := user_api.user_has_permission (a_user, a_permission)
end
feature -- Query: module
module (a_type: TYPE [CMS_MODULE]): detachable CMS_MODULE