Enforce that a Member can only be associated with Role if access_level matches
Background
The ~"group::authentication and authorization" team has been working towards enabling custom roles and permissions in GitLab. We started with a technical discovery, and from that, we had the following outcome:
- create a new model
Rolewith a 2 columns for now:base_access_level,download_code. Add association viaMember#role_id(weight:2) - enforce that a
Membercan only be associated withRoleifaccess_levelmatches (weight:2) - enforce
Member#access_levelcannot be changed if associated with a custom role (weight:2) - create UI to edit the Role (weight:
5) / or just API as the description suggests (weight:3) - edit
ProjectPolicy: depending on the feature flagdownload_codeshould use the existing logic or evaluate it based on theRoleassociated with the user in that group hierarchy (weight:3) - evaluate performance (we might want to involve groupscalability) and define next steps based on that
These tasks will allow us to enable us to evaluate performance constraints. This feature is not user facing.
Requirements
This is Second step based on the technical discovery:
enforce that a
Membercan only be associated withRoleifaccess_levelmatches
Edited by Hannah Sutor