Added notion of author (owner) and editor to allow the editing of node by non owner users.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user