Resolve: Archived project settings gets "An error occurred fetching the approval rules"
What does this MR do and why?
When a project is archived, you can't update approvals in a project. The update_approvers
was being checked to determine if approvals can be read. A project admin should be allowed to read them.
This MR allows a user with admin_project
permissions to read the project approvals.
How to set up and validate locally
-
Pick a project that is currently unarchived.
-
Run this in the terminal:
curl -X GET http://localhost:3000/api/v4/projects/<PROJECT-ID>/approvals --header "PRIVATE-TOKEN: <PRIVATE-TOKEN>"
You should get back something similar to
{"approvers":[],"approver_groups":[],"approvals_before_merge":0,"reset_approvals_on_push":true,"disable_overriding_approvers_per_merge_request":false,"merge_requests_author_approval":false,"merge_requests_disable_committers_approval":false,"require_password_to_approve":false}
-
Archive the project
-
Run the above command again, you should get back the same values.
-
If you run the same command on
master
, you will get{"message":"403 Forbidden"}
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.
Related to #27934 (closed)