Added notion of author (owner) and editor to allow the editing of node by non owner users.
This commit is contained in:
@@ -275,7 +275,11 @@ feature -- Hooks
|
||||
if l_entity.is_published then
|
||||
if l_entity.author = Void then
|
||||
-- FIXME!!!
|
||||
l_entity.set_author (l_page_api.cms_api.user)
|
||||
if attached l_entity.editor as l_editor then
|
||||
l_entity.set_author (l_editor)
|
||||
else
|
||||
l_entity.set_author (l_page_api.cms_api.user)
|
||||
end
|
||||
a_import_ctx.log (l_node_type.name + " %"" + fp.utf_8_name + "%" WARNING (Author is unknown!)")
|
||||
end
|
||||
if attached l_entity.author as l_author then
|
||||
|
||||
@@ -72,13 +72,13 @@ feature -- Access
|
||||
feature {NONE} -- Queries
|
||||
|
||||
sql_select_available_parents_for_node : STRING = "[
|
||||
SELECT node.nid, node.revision, node.type, title, summary, content, format, author, publish, created, changed, status
|
||||
SELECT node.nid, node.revision, node.type, title, summary, content, format, author, editor, publish, created, changed, status
|
||||
FROM nodes node LEFT JOIN page_nodes pn ON node.nid = pn.nid AND node.nid != :nid
|
||||
WHERE node.nid != :nid AND pn.parent != :nid AND node.status != -1 GROUP BY node.nid, node.revision;
|
||||
]"
|
||||
|
||||
sql_select_children_of_node: STRING = "[
|
||||
SELECT node.nid, node.revision, node.type, title, summary, content, format, author, publish, created, changed, status
|
||||
SELECT node.nid, node.revision, node.type, title, summary, content, format, author, editor, publish, created, changed, status
|
||||
FROM nodes node LEFT JOIN page_nodes pn ON node.nid = pn.nid
|
||||
WHERE pn.parent = :nid AND node.status != -1 GROUP BY node.nid, node.revision;
|
||||
]"
|
||||
|
||||
Reference in New Issue
Block a user