Poc dynamic role creation #1282
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces dynamic role creation and assignment for users.
Motivation and Context
This change is necessary to provide flexibility in role management and permissions handling. It aims at solving the problem of hard-coded roles and permissions, making the system more flexible to accommodate different user access levels and permissions.
Changes
ProposalAuthorizationandUserAuthorizationto check data access and permissions for the dynamically created roles.My proposal is to continue using pre-defined roles and dashboards, but allow for the creation of dynamic roles that has two attributes: “data access” and “permissions/config”. I added a new role/dashboard, dynamic_proposal_reader, and created two dynamic roles—ISIS_READ and CLF_READ—both using the dynamic_proposal_reader role/dashboard. The only difference between these roles is the set of instruments associated with each. That would allow users to login and see a proposal table with only the proposals that has the instruments associated with their dynamic role.
We would need to define a set list of dashboards to be used, we can do minor configurations for each dashboard using a config defined on the dynamic role and we can set the data access either by using tags or instruments. I have not shared this approach with the STFC/ELI team yet, but it would be great to know if this approach is at all viable.
It would also allow for different facilities to rename roles like FAP Reviewer to PEP Reviewer.