Added read_usage_quotas ability to ProjectPolicy
What does this MR do and why?
Closes: https://gitlab.com/gitlab-org/gitlab/-/issues/338706
Added a new ability in the ProjectPolicy for allowing access to read_usage_report, this change was suggested as part of !68289 (comment 652353799). The initial change was behind a feature flag, but the current production change does not have any feature flag, so for now the ability is similar to :admin_poject
What do you think of adding a
read_usage_quotas
permission toProjectPolicy
to use here? Or potentially adding it in a follow up MR? I can definitely foresee a product-need to have a unique permissions for viewing/managing usage quotas, separate fromadmin_project
. Usingadmin_project
is a fine first step, but it's always easier to start with separate permissions for a feature and combine them if needed, rather than to break apart permissions later on after the feature has grown to have many tendrils.
Screenshots or screen recordings
How to set up and validate locally
- Create a project and navigate to
<project_owner_user_name>/<project-name>/-/usage_quotas
, you should be able to see project details like the above screenshot. Alternatively you can also try to navigate by going to theProject > Settings > Usage Quotas
, but you wont see "Settings" if you are not the owner or maintainer of the project - Test with new user having guest, report, developer role to the project, the same path should show 404
- Test with new user having owner, maintainer role to the project, you should be able to see project details like the above screenshot
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.