SORMAS-Foundation / SORMAS-Project

SORMAS (Surveillance, Outbreak Response Management and Analysis System) is an early warning and management system to fight the spread of infectious diseases.
https://sormas.org
GNU General Public License v3.0
291 stars 142 forks source link

User role management #898

Open MartinWahnschaffe opened 5 years ago

MartinWahnschaffe commented 5 years ago

Situation Description

Based on #830.

General idea is to get rid of fixed user roles and replace them with user rights only that can be combined in a configurable user role. The default user roles would be based on the existing SORMAS user roles.

Consider:

Proposed Solution

List: https://app.moqups.com/3NUENEwuOE/view/page/ab4eb9432 Edit: https://app.moqups.com/3NUENEwuOE/view/page/a46f29001

Task list

Preparation

User Role Configuration

User Right Backend Checks

Additional Information

This was more a task before, before we decided to introduce epic. Now as an epic this is open again to point out what needs to be done to complete the epic.

Result summary from the concept phase is here, but now copied to this description.

Add short documentation for this: https://github.com/hzi-braunschweig/SORMAS-Project/blob/development/docs/SERVER_CUSTOMIZATION.md#user-role-configuration

bernardsilenou commented 4 years ago

@MartinWahnschaffeSymeda : With respect to your point 2 (limit the available user rights for each role based on availability for web and app. E.g. deletion, import, export, archive, etc. are only available for the web app), What is the challenge if we do not limit the user roles. What I mean is that the a user with the rights of the current informant/ SO will be able to use the web application also. Every role (which will be a combination of cert in rights) will be able to use the web. In addition to this, certain roles, like informant will have the additional option to use the mobile version or SORMAS.

MateStrysewske commented 4 years ago

Additional questions:

MateStrysewske commented 4 years ago

Current concept: Store a UserRole entity in the database that has a "name" column, a "default" column (boolean, true if it's a default SORMAS user role; default roles should not be deletable from the UI) and a "userrights" JSONB column which contains a single key/value pair with the names of all user rights that are enabled for this user role as an array.

Operation to select all user roles with a specific user right: SELECT * FROM table_name WHERE column_name @> '{"attribute_name": ["value"]}';

Operations to add/remove elements to/from the array: UPDATE table_name SET column_name = (SELECT jsonb_set(column_name, '{attribute_name}', (column_name->'attribute_name') || '"new_value"') FROM table_name AS t WHERE t.id = table_name.id) UPDATE table_name SET column_name = (SELECT jsonb_set(column_name, '{attribute_name}', (column_name->'attribute_name') - 'removed_value') FROM table_name AS t WHERE t.id = table_name.id)

MateStrysewske commented 4 years ago

Current user role combinations in the Nigerian system:

Further combinations that are only set for one user:

Initial thoughts:

MateStrysewske commented 4 years ago

New mockups: https://app.moqups.com/3NUENEwuOE/view/page/ab4eb9432 https://app.moqups.com/3NUENEwuOE/view/page/ad7b3a18e

MateStrysewske commented 4 years ago

Additional request from Ghana: We should probably make sure that the "Admin" role is not deletable and that there is a specific user right that allows/prevents the creation of "Admin" users (see #1475)

MartinWahnschaffe commented 4 years ago

Clean up / refinements to be done before this:

2215

DONE:

2237 #2238 #2239

markusmann-vg commented 4 years ago

Source of roles, entities & functionalities (generated xls-sheet) needs to be considered

Deliverable: concept with follow up stories for the implementation part

MartinWahnschaffe commented 4 years ago

List: https://app.moqups.com/3NUENEwuOE/view/page/ab4eb9432 Edit: https://app.moqups.com/3NUENEwuOE/view/page/a46f29001

Preparation

User Role Configuration

User Right Backend Checks

StefanKock commented 3 years ago

Temporarly moved the ticket out of Done column to archive tickets of Sprint 100

StefanKock commented 2 years ago

With redefining this as epic, it is considered to still be open.

kwa20 commented 2 years ago

@MartinWahnschaffe After a discussion with @MateStrysewske and @JaquM we came to the conclusion that #5656 is mostly obsolete with the overall implementation of this concept. The relevant information that remain are the following:

I'll discard the existing issue but couldn't identify where else to put it. Feel free to add it wherever applicable.

SORMAS-ZohaibHassan commented 2 years ago

I am hoping that we are adding a Mobile app login ability as well in this user management thing.

MartinWahnschaffe commented 2 years ago

I am hoping that we are adding a Mobile app login ability as well in this user management thing.

What do you mean by login ability? A user right that allows/forbids users to use the mobile app?

kwa20 commented 2 years ago

Add short documentation for this: https://github.com/hzi-braunschweig/SORMAS-Project/blob/development/docs/SERVER_CUSTOMIZATION.md#user-role-configuration

A wiki entry for userrole configuration shoud be added as well

abrudanancuta commented 2 years ago

The new discovered scenarios while doing exploratory testing on User Right & Roles:

Bugs and changes

roxanamlendea commented 2 years ago

Other issues related to User Rights and Roles:

adinaflorea9 commented 2 years ago

Other issues related to User Roles and Rights:

adinaflorea9 commented 1 year ago

Other issues related to User Roles and Rights: