Skip to content

Adjust Issue/Incident Management policies when read-only

Vijay Hawoldar requested to merge vij-issue-policies into master

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

  1. Checkout master branch
  2. Adjust the read_only? method to return true
      def read_only?
        true
      end
  3. Attempt to create or otherwise manage existing issues, including creating comments
  4. Attempt to create an incident (Project -> Monitor -> Incidents)
  5. 👆🏽 should not be possible
  6. Checkout this branch (vij-issue-policies)
  7. Re-attempt to perform the same actions
  8. 👆🏽 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.

Edited by Vijay Hawoldar

Merge request reports