Adjust Issue/Incident Management policies when read-only
What does this MR do and why?
In https://gitlab.com/gitlab-org/gitlab/-/issues/363473 we are adjusting which features/abilities are restricted when a Namespace is made read-only.
When a namespace is made read-only, it uses the ReadonlyAbilities
concern to determine which features and abilities should be restricted.
We cannot simply modify those lists because the same concern is used for other locking actions too, such as when a project is archived.
So to achieve this goal, this MR refactors the concern into two, one for Archived abilities and one for Readonly
In total this MR will allow the following actions:
Issues:
- create
- update
- reopen
- upload design
- add comment
- read IID
Incident Management:
- create incident
Please note: 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 to create or otherwise manage existing issues, including creating comments
- Attempt to create an incident (Project -> Monitor -> Incidents)
-
👆🏽 should not be possible - Checkout this branch (
vij-issue-policies
) - Re-attempt to perform the same actions
-
👆🏽 should be possible
Numbered steps to set up and validate the change are strongly suggested.
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.