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

Discussion: Should roles be referenced by name instead of ID #2

Open
u12206050 opened this issue May 2, 2022 · 0 comments
Open

Discussion: Should roles be referenced by name instead of ID #2

u12206050 opened this issue May 2, 2022 · 0 comments

Comments

@u12206050
Copy link
Owner

Currently roles are exported with their ID's and used in permissions to reference which role has a specific permission. This does make reading the permissions config a bit hard as role ids are UUID and don't make much sense unless you map them to the role in the roles.yaml file.

So far I see one solution with two ways to implement, but both do have down sides.

Solution: Use the role's name instead of the id

Implementation 1 Use the role's name as reference in the permissions, but map it to the roles.yaml file where the original role ID can be found.

  • Renaming a role would require a search and replace across all permissions (carefully)

Implementation 2: Don't store any role ids, just use the role's name as reference, both in permissions and roles.yaml

  • Renaming a role would involve a full export of all permissions again. This can be done via a hook.
  • Any renaming would require keeping track of previous names in order to sync back into other environments, this could be tricky and opens a can of exceptions that could make the update fail.

Both implementations could be triggered automatically, but no. 1 seems the safer option. It would give us the original IDs to be able to update the roles when needed, as well as provide the benefit of understanding the permissions better by using names as references.

Any suggestions.

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

No branches or pull requests

1 participant