Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[roles] new module #8929

Closed
wants to merge 70 commits into from
Closed

[roles] new module #8929

wants to merge 70 commits into from

Conversation

regisoc
Copy link
Contributor

@regisoc regisoc commented Nov 3, 2023

Brief summary of changes

New roles manager module.

Roles are pre-configured sets of permissions automatically assigned when the user is given a new role. This feature allows managers/coordinators to assign permissions to users based on their roles in a study.

New in roles_manager (roles + role-permissions):

  • a main table managing roles and their associated permissions.
  • if users are attributed to a role, changing permissions of that role will trigger the update of user permissions for all user having this role.

Changes in user_account module (users + user-permissions + user-role):

  • permissions are now disabled by default. Permissions goes through role selection.
  • new component to select which roles are to be attributed to a user.

Also:

  • Added: generic vertical Collapsible React component.
  • Added: tool to check/fix roles anomalies, e.g. if a user has been affected to a role through SQL, checks if permissions matches.
  • Removed: permission_category table.
  • Added: roles, user_role_rel, role_permission_rel tables.

Other tasks:

  • Documentation
    • readme
    • test plan
  • Raisinbread
    • remove permission category
    • add role, role-permission, user-role data
  • Tests
    • remove permission category references in UserTests
    • add Role lib tests
    • add roles_manager module tests
    • update user_accounts module tests for role selection

Screenshots of the current state

Click to see the screenshots

Main Role page
image

Edit Role page
image

User account role selection
image

Testing instructions (if applicable)

  1. Apply patch 2023-11-03_roles_module.sql or make testdata.
  2. Go to LORIS front-end > Admin > Roles Manager and LORIS front-end > Admin > user accounts

Link(s) to related issue(s)

Linked to #7416

@regisoc regisoc mentioned this pull request Nov 3, 2023
14 tasks
@driusan
Copy link
Collaborator

driusan commented Jan 16, 2024

@regisoc assigning this to you because it's failing tests and needs a rebase

@regisoc regisoc marked this pull request as ready for review February 12, 2024 13:34
@regisoc
Copy link
Contributor Author

regisoc commented Feb 12, 2024

@driusan not all tests there, I will try to do that today.
Some functions need to move but main logic can be reviewed.

@regisoc
Copy link
Contributor Author

regisoc commented Feb 13, 2024

@driusan after our discussion, this PR will be cut down in 3:

  1. roles_manager itself for this release.
  2. Collapsible LORIS React element.
  3. user_accounts changes for later.

@driusan
Copy link
Collaborator

driusan commented Feb 13, 2024

What is the difference between the Collapsible component and jsx/Panel.js?

@regisoc
Copy link
Contributor Author

regisoc commented Feb 13, 2024

Good point, I did not know Panel was a collapsible.
I have only seen it without collapsed element somehow.
So only 2 points then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants