caseflow
caseflow copied to clipboard
Ryan/appeals 35475
Resolves Team Management Page: Add permissions UI Elements
Description
This PR causes the following changes
- Checkbox elements now appear on the team management page for organizations
- These checkboxes are based off the OrganizationPermission model.
- Checking a checkbox will add / remove the permission for the selected user
- if a user is an admin, they will by default have any default_for_admin permisisons
- default_for_admin attribute added to OrganizationPermission (default false value)
- if a permission has a child permission, it will not be viewable unless the parent checkbox is also checked.
- Seed data has been updated so that all permission types currently inside of the constants file are created.
Acceptance Criteria
- [X] Code compiles correctly
- [X] On the Organization Management page permissions for the organization are listed next to each user
- [X] At the top of the section the sentence "User Permissions"
- [X] Each permission for an organization has a checkbox followed by its description
- [X] The checkbox is checked if the listed user has the permission for the organization
- [X] Deselection of permission will remove the permission from the user
- [X] Upon selection of permission, the permission is granted to the user
- [X] If user has admin rights, any default admin permissions are displayed, checked, and grayed out
- [X] permission is not selectable
- [X] If organization does not have permissions for users, the UI is not displayed
- [X] On the Inbound Ops Organization Management page permissions for the organization are listed next to each user
- [X] Under the "Edit current team members" header, the "Add/Remove admin rights" sentence is updated:
- [X] Grants the ability to manage team membership and perform superuser actions.
- [X] Each permission for an organization has a checkbox followed by its description
Testing Plan
- Navigate to /organizations/inbound-ops-team/users while signed in as an admin user
- Notice that there are checkboxes for each permission next to each other
- check one of each checkbox. notice that the 'receive NOD mail' checkbox only appears once the auto assignment checkbox is checked.
- Reload the page and note that the permissions persist.
- Give a user admin rights. note that all checkboxes dissapeared and superuser is the only checkbox remaining, and is also enabled by default without being able to be changed.
Frontend
User Facing Changes
- [X] Screenshots of UI changes added to PR & Original Issue
BEFORE|AFTER
Backend
Database Changes
Only for Schema Changes
- [X] Have your migration classes inherit from
Caseflow::Migration
, especially when adding indexes (useadd_safe_index
) (see Writing DB migrations) - [X] Verify that
migrate:rollback
works as desired (change
supported functions)
Best practices
Code Documentation Updates
- [X] Add or update code comments at the top of the class, module, and/or component.
Tests
Test Coverage
Did you include any test coverage for your code? Check below:
- [X] RSpec
- [ ] Jest
- [ ] Other
Code Climate
Your code does not add any new code climate offenses? If so why?
- [X] No new code climate issues added