Adjust Merge Request policies for read-only state
What does this MR do and why?
In https://gitlab.com/gitlab-org/gitlab/-/issues/363473 we are adjusting which features are made read-only.
This MR adjusts the actions for merge requests from that list, allowing:
- adding approvals
- re-opening
- adding comments
- resolving comments
Read-only mode is not yet in use because it relates to unreleased work described in the linked issue above
How to set up and validate locally
- Checkout
master
branch - Adjust the
read_only?
method to return truedef read_only? true end
- Attempt perform the above actions on an MR
-
👆🏽 should not be possible - Checkout this branch (
vij-mr-policies
) - Re-attempt to perform the same actions
-
👆🏽 should be possible
Alternative
- Perform step 1 and 2 above
- In a rails console, perform the following before/after checking out this branch:
u = User.first # or a user of your choice mr = MergeRequest.first # or an MR the user has developer/maintainer access too [:approve_merge_request, :reopen_merge_request, :create_note, :resolve_note].each { |policy| puts u.can?(policy, mr) }
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.
Edited by Vijay Hawoldar