Updated navigation templte to include current user.
Updated CMS_NODE, CMS_USER. Added USER_PROFILE and USER_ROLE Updated new USER_DATA_PROVIDER and NODE_DATA_PROVIDER to support new features. Added ROLE_DATA_PROVIDER. Updated test cases. Updated MySQL database schema.
This commit is contained in:
90
persistence/implementation/common/model/cms_user_role.e
Normal file
90
persistence/implementation/common/model/cms_user_role.e
Normal file
@@ -0,0 +1,90 @@
|
||||
note
|
||||
description: "Summary description for {CMS_USER_ROLE}."
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
CMS_USER_ROLE
|
||||
|
||||
inherit
|
||||
ANY
|
||||
redefine
|
||||
is_equal
|
||||
end
|
||||
|
||||
create
|
||||
make,
|
||||
make_with_id
|
||||
|
||||
feature {NONE} -- Initialization
|
||||
|
||||
make_with_id (a_id: like id; a_name: like name)
|
||||
do
|
||||
id := a_id
|
||||
make (a_name)
|
||||
end
|
||||
|
||||
make (a_name: like name)
|
||||
do
|
||||
name := a_name
|
||||
create {ARRAYED_LIST [READABLE_STRING_8]} permissions.make (0)
|
||||
end
|
||||
|
||||
feature -- Status report
|
||||
|
||||
has_id: BOOLEAN
|
||||
do
|
||||
Result := id > 0
|
||||
end
|
||||
|
||||
has_permission (p: READABLE_STRING_8): BOOLEAN
|
||||
do
|
||||
Result := across permissions as c some c.item.is_case_insensitive_equal (p) end
|
||||
end
|
||||
|
||||
feature -- Access
|
||||
|
||||
id: INTEGER
|
||||
|
||||
name: READABLE_STRING_8
|
||||
|
||||
permissions: LIST [READABLE_STRING_8]
|
||||
|
||||
feature -- Comparison
|
||||
|
||||
same_user_role (r: CMS_USER_ROLE): BOOLEAN
|
||||
do
|
||||
Result := r.id = id
|
||||
end
|
||||
|
||||
is_equal (other: like Current): BOOLEAN
|
||||
-- Is `other' attached to an object considered
|
||||
-- equal to current object?
|
||||
do
|
||||
Result := id = other.id
|
||||
end
|
||||
|
||||
feature -- Change
|
||||
|
||||
set_id (a_id: like id)
|
||||
-- Set `id' with `a_id'.
|
||||
do
|
||||
id := a_id
|
||||
ensure
|
||||
set_id: id = a_id
|
||||
end
|
||||
|
||||
set_name (a_name: like name)
|
||||
-- Set `name' with `a_name'.
|
||||
do
|
||||
name := a_name
|
||||
ensure
|
||||
name_set: name = a_name
|
||||
end
|
||||
|
||||
add_permission (n: READABLE_STRING_8)
|
||||
do
|
||||
permissions.force (n)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user