Added blog module as example, this is far from being a real blog module.
but this is an example about on to add a new content type, and support it. Fixed new node form workflow. The current state is not final, it requires many changes, but for now, it implements a node editing workflow.
This commit is contained in:
@@ -46,13 +46,22 @@ feature -- Status report
|
||||
elseif a_user = Void then
|
||||
Result := user_role_has_permission (anonymous_user_role, a_permission)
|
||||
else
|
||||
Result := user_role_has_permission (authenticated_user_role, a_permission)
|
||||
if not Result then
|
||||
Result := across user_roles (a_user) as ic some user_role_has_permission (ic.item, a_permission) end
|
||||
if is_admin_user (a_user) then
|
||||
Result := True
|
||||
else
|
||||
Result := user_role_has_permission (authenticated_user_role, a_permission)
|
||||
if not Result then
|
||||
Result := across user_roles (a_user) as ic some user_role_has_permission (ic.item, a_permission) end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
is_admin_user (u: CMS_USER): BOOLEAN
|
||||
do
|
||||
Result := u.id = 1
|
||||
end
|
||||
|
||||
user_roles (a_user: CMS_USER): LIST [CMS_USER_ROLE]
|
||||
local
|
||||
l_roles: detachable LIST [CMS_USER_ROLE]
|
||||
|
||||
Reference in New Issue
Block a user