Added notion of author (owner) and editor to allow the editing of node by non owner users.

This commit is contained in:
2017-03-03 11:12:51 +01:00
parent 4cbdfeff06
commit 6cb6dd1609
18 changed files with 248 additions and 70 deletions

View File

@@ -243,15 +243,23 @@ feature -- Access: Node
check has_link: Result.has_id implies attached Result.link as lnk and then lnk.location.same_string (node_link (Result).location) end
-- Update partial user if needed.
if
Result /= Void and then
attached {CMS_PARTIAL_USER} Result.author as l_partial_author
then
if attached cms_api.user_api.user_by_id (l_partial_author.id) as l_author then
Result.set_author (l_author)
else
check
valid_author_id: False
if Result /= Void then
if attached {CMS_PARTIAL_USER} Result.author as l_partial_author then
if attached cms_api.user_api.user_by_id (l_partial_author.id) as l_author then
Result.set_author (l_author)
else
check
valid_author_id: False
end
end
end
if attached {CMS_PARTIAL_USER} Result.editor as l_partial_editor then
if attached cms_api.user_api.user_by_id (l_partial_editor.id) as l_editor then
Result.set_editor (l_editor)
else
check
valid_author_id: False
end
end
end
end