Done
Pinned fields
Click on the next to a field label to start pinning.
Details
Details
Assignee
Mateusz Kwiatkowski
Mateusz KwiatkowskiReporter
Sam Im
Sam Im(Deactivated)Labels
Story Points
8
Original estimate
3d
Time tracking
Components
Sprint
Add sprint
Fix versions
Priority
Time Assistant
Time Assistant
Created March 24, 2017 at 1:11 AM
Updated August 23, 2017 at 6:51 PM
Resolved April 21, 2017 at 1:02 PM
As an administrator I need to assign users to roles so that they can complete their daily tasks per enabled role permissions.
Acceptance Criteria:
When admin selects a user to edit (OLMIS-2011) they are brought to the User details screen where they select Edit to assign roles (see mockup). This allows for the admin to assign a Requisition Role by Facility by Role permissions to the user. This new tab is always present in the Edit User modal. (Fulfillment and Reporting Roles are future stories.)
When admin selects Roles tab, Supervisory Node details are displayed in the view.
Admin can change user role assignments by clicking link "Roles" that is located in Actions column on Users list screen. Then he is redirected to Edit user roles page. This allows for the admin to assign a Supervision, Fulfillment, Reports or Administration role to user.
There is a label at the top of the screen that shows username.
Roles are split by type into four groups: Supervision, Fulfillment, Reports and Administration. They are accessible by selecting proper tab. Supervision tab is selected by default.
Only user role assignments which type match one selected in tab can be displayed in table. Each row will have "Actions" column with button "Remove Role" button and "Role" column with role name displayed. For Supervision tab there will be additional "Supervisory node" and "Program" columns with. For Fulfillment roles there will be additional "Warehouse" column.
To edit the Supervisory Node, there is a new "Manage" button that the admin selects to bring them to the Edit Roles modal. In the Edit Roles modal, the Facility drop-down is pre-populated with the available facilities that they can be assigned to the role. (Assumption is that the facilities will be pre-populated with any facilities that have already been set up in the database. Facility creation via admin screens is not in scope for this story.)
Above the table there is a in-line form for adding a new role to user with a drop-down for each column in the current table. Each drop-down is populated with proper values. When admin selects a facility, then the dropdown for role is pre-populated with available role types that exists in the system or admin has set up in OLMIS-2189.
Admin clicks the Add button to assign the role.
If there are no role assignments, the table displays with a message "No roles assigned"
Admin clicks the "Add role" button to assign the role. It is located to the right of last drop-down.
Validation is completed for the facility selected and the role assigned. A user cannot be assigned multiple roles for the same facility, but a facility must be assigned for a role to be selected. So when the admin selects a role and a facility for that role for the user, that facility should not be available in the next dropdown to select.
Validation is completed for the supervisory node selected and the role assigned. A user cannot be assigned multiple roles for the same supervisory node. So when the admin selects a role and a supervisory node for that role for the user, that facility should not be available in the next dropdown to select.
If a role has been assigned, the Add button will change to Remove so that the admin can remove the assignment if needed.
Program have to be selected to create a Supervision role and it is marked as required.
When Admin selects Save to commit changes, and is brought back to the view User Roles screen where the changes appear in the view.
When Admin selects Cancel they are brought back to the view User Roles screen, and no changes are saved.
When Admin is in View Roles modal, they can select "x" to go back to previous screen of the User search.
If a role has been assigned, the role will be added to the table and all selections in drop-downs are cleared after role has been added successfully.
Admin can remove the assignment by clicking "Remove role" button if needed. If admin selects to "Remove Role", a message appears that says "Selected role assignments will be removed. Do you want to continue?". Then admin can select "Remove role" or "Cancel". If admin selects cancel, no changes are made. If admin selects Continue, the role is removed from the table.
When Admin selects "Save user roles" to commit changes, all role assignments are saved, and the admin is brought back to the User list screen and success notification will appear.
When Admin selects "Cancel" they are brought back to User list screen, and no changes are saved. When Admin is in View Roles modal, they can select "x" to go back to previous screen of the User search.
User list with "Roles" link -
User roles edit screen -
Assumptions:
Facilities setup is a separate workflow.
Supervisory nodes in test will be used for this story, setting up new or editing Supervisory Nodes is a separate story.