Skip to content

Commit

Permalink
Add a feature toggle to allow users with VIEWER role to be oncalls
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandr-ku-MA committed Dec 19, 2024
1 parent 54ff63a commit b950011
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion engine/apps/api/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,13 @@ class Permissions:
)

NOTIFICATIONS_READ = LegacyAccessControlCompatiblePermission(
Resources.NOTIFICATIONS, Actions.READ, LegacyAccessControlRole.EDITOR
Resources.NOTIFICATIONS,
Actions.READ,
(
LegacyAccessControlRole.VIEWER
if settings.FEATURE_ALLOW_VIEWERS_ON_CALL
else LegacyAccessControlRole.EDITOR
),
)

NOTIFICATION_SETTINGS_READ = LegacyAccessControlCompatiblePermission(
Expand Down
2 changes: 2 additions & 0 deletions engine/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
FEATURE_ALERT_GROUP_SEARCH_CUTOFF_DAYS = getenv_integer("FEATURE_ALERT_GROUP_SEARCH_CUTOFF_DAYS", default=None)
FEATURE_NOTIFICATION_BUNDLE_ENABLED = getenv_boolean("FEATURE_NOTIFICATION_BUNDLE_ENABLED", default=True)
FEATURE_DECLARE_INCIDENT_STEP_ENABLED = getenv_boolean("FEATURE_DECLARE_INCIDENT_STEP_ENABLED", default=False)
# Allow users with legacy role VIEWER to be on call
FEATURE_ALLOW_VIEWERS_ON_CALL = getenv_boolean("FEATURE_ALLOW_VIEWERS_ON_CALL", default=False)

TWILIO_API_KEY_SID = os.environ.get("TWILIO_API_KEY_SID")
TWILIO_API_KEY_SECRET = os.environ.get("TWILIO_API_KEY_SECRET")
Expand Down

0 comments on commit b950011

Please sign in to comment.