Skip to content

Draft: Hide access_level value when it the Access Level is not role based

Joe Woodward requested to merge fix/461213-branch_rule-access_levels into master

What does this MR do and why?

ProtectedBranch and ProtectedTag have different types of access levels to protect actions. These include PushAccessLevel, MergeAccessLevel, UnprotectAccessLevel, and CreateAccessLevel records.

These Access Levels can be either configured for a members role, or for a specific user, group, or deploy key.

Role based Access Level records configure which roles can perform the protected action by setting a access_level value which corresponds with a Gitlab::Access level value.

When the Access Levels are associated with a user, group, or deploy key we ignore the access_level value. We currently return this value in our APIs which creates confusion.

This change means we only return the access_level value when the Access Level is a role based level, making the API responses easier to understand.

Related to #461213 (closed)

Changelog: changed

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Joe Woodward

Merge request reports