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

Consider adding proper support for non-organisation-specific roles #984

Open
floehopper opened this issue Apr 17, 2024 · 1 comment
Open

Comments

@floehopper
Copy link
Contributor

In RaspberryPiFoundation/editor-api#258 authorization logic for "school-owner", "school-teacher" & "school-student" roles was added. However, each of these roles was made organisation-specific and a single user is able to have different roles per organisation.

In the meantime in the main branch a "editor-admin" role was added to gate access to the admin dashboard. When rebasing the branch in RaspberryPiFoundation/editor-api#258, we had to resolve some conflicts in this area of the code (e.g. User#admin?) and we achieved that by saying that a user should have access to the admin dashboard if they have the "editor-admin" role for any organisation.

While the latter is probably OK for now, it's a bit of a bodge and we might want to give some more thought to how the authorization logic for roles like this ought to work.

@sra405
Copy link
Contributor

sra405 commented Apr 17, 2024

Just a couple of thoughts. Currently I'm torn between two approaches:

  1. Not every role assignment needs to be assigned to an organisation - this way we can set generic roles that apply across our products. The implications here are we need to handle organisation roles and generic roles separately.
  2. Every role is assigned to an organisation - currently profile roles are used primarily (if not exclusively) for internal purposes giving access to things like admin dashboard or moderator privileges. The implication being we add a RPF organisation and alter the appropriate locations to check for the RPF org as well as the required role.

fyi @grega @DanielBrierton

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

2 participants