Access control
Role concept
- User: Login with user name and password
- Group: Users can belong to one or multiple groups
- Role: User and/or groups have roles.
- Permissions: Permissions for certain resources (e.g. topics, WMS services) are assigned to roles
Special users and roles: A special user named admin with all permissions is added automatically. For each site a role with the same name is defining the permissions for a public user not logged in.
Example:
- This role has the following permissions
- User
lieniis member of groupforest_editors - This group has role
forest_edit
Permission:
Layer +show ForestMap/*
Tool +show ForestMap/EditTool
Topic +edit ForestMap
Layer +edit ForestMap/Forest
Self organized groups
Signup workflow:
- User receives invitation mail with signup link
- Sign up of users
- Group administrator receives a mail with direct link for activating users
Administration page with links to all topics with self-administration: http://maps.example.com/groups_users
Signup link example for a user: http://maps.example.com/session/sign_up?group=forest_editors
Preparation:
- Create roles. E.g.
exampleedit,exampleviewandexampleadmin - Assign one ore more users the
exampleadminrole - Create groups. E.g.
examplegroupeditandexamplegroupview - Assign roles to groups:
examplegroupedit->exampleedit,examplegroupview->exampleview - Assign permissions to the roles. E.g.
exampleeditis allowed to edit a the example topic - Set permission for action
editof resource typeGroupfor admin role. E.g. roleexampleadminfor groupexamplegroupeditundexamplegroupview
Optional: Extend registration forms with group specific fields:
- Add a partial
_app_infos.html.erbwith specific fields in directoryapp/views/registrations/GROUPNAME - Add a group specific mail text in
_app/views/groups_users/mails/_GROUPNAME.html.erb
Send signup URL for groups to invited users.
If you add users manually to groups, don’t forget to mark the membership granted flag.