Skip to content

Guard On-call Schedule and Escalation Policies URLs if disabled

Peter Leitzen requested to merge pl-monitor-off-oncall-escalation into master

What does this MR do and why?

In project settings Settings > General > Visibility, project features, permissions users can disable Operation feature (soon Monitor feature - still behind feature flag).

When disabled the Monitor menu in the sidebar was hidden, however, users still could access features directly via the URL.

This MR prevents direct access via the URL for On-call Schedule and Escalation Policies features if the Operation feature (soon Monitor feature) is disabled.

This MR contains changes for both:

  • Settings > General > Visibility, project features, permissions > Operations
  • Settings > General > Visibility, project features, permissions > Monitor (still behind feature flag split_operations_visibility_permissions see rollout issue).

Refs #364240 (comment 1164761836)

Screenshots or screen recordings

Settings / Page On-call Schedules Escalation Policies
Operations Screenshot_from_2022-11-10_16-04-34 Screenshot_from_2022-11-10_16-04-43
Operations Screenshot_from_2022-11-10_16-06-59 Screenshot_from_2022-11-10_16-06-59
Monitor Screenshot_from_2022-11-10_16-04-34 Screenshot_from_2022-11-10_16-04-43
Monitor Screenshot_from_2022-11-10_16-06-59 Screenshot_from_2022-11-10_16-06-59

How to set up and validate locally

Monitor toggle - feature flag split_operations_visibility_permissions enabled

  1. In Rails console: Feature.enable(:split_operations_visibility_permissions)
  2. Setup On-call Scheudules
  3. Setup Escalation Policies
  4. Go to projects Settings > General > Visibility, project features, permissions > Monitor and toggle
  5. Login as Reporter (or higher)
  6. Visit http://localhost:3000/gitlab-org/gitlab-test/-/oncall_schedules
  7. Visit http://localhost:3000/gitlab-org/gitlab-test/-/escalation_policies

Operations toggle - feature flag split_operations_visibility_permissions disabled

  1. In Rails console: Feature.remove(:split_operations_visibility_permissions)
  2. Setup On-call Scheudules
  3. Setup Escalation Policies
  4. Go to projects Settings > General > Visibility, project features, permissions > Operations and toggle
  5. Login as Reporter (or higher)
  6. Visit http://localhost:3000/gitlab-org/gitlab-test/-/oncall_schedules
  7. Visit http://localhost:3000/gitlab-org/gitlab-test/-/escalation_policies

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 Peter Leitzen

Merge request reports