Skip to content

Commit 0c824dc

Browse files
Add a feature toggle to allow users with VIEWER role to be oncalls
1 parent 34eec39 commit 0c824dc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

engine/apps/api/permissions.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,13 @@ class Permissions:
261261
)
262262

263263
NOTIFICATIONS_READ = LegacyAccessControlCompatiblePermission(
264-
Resources.NOTIFICATIONS, Actions.READ, LegacyAccessControlRole.EDITOR
264+
Resources.NOTIFICATIONS,
265+
Actions.READ,
266+
(
267+
LegacyAccessControlRole.VIEWER
268+
if settings.FEATURE_ALLOW_VIEWERS_ON_CALL
269+
else LegacyAccessControlRole.EDITOR
270+
),
265271
)
266272

267273
NOTIFICATION_SETTINGS_READ = LegacyAccessControlCompatiblePermission(

engine/settings/base.py

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@
7777
FEATURE_NOTIFICATION_BUNDLE_ENABLED = getenv_boolean("FEATURE_NOTIFICATION_BUNDLE_ENABLED", default=True)
7878
FEATURE_DECLARE_INCIDENT_STEP_ENABLED = getenv_boolean("FEATURE_DECLARE_INCIDENT_STEP_ENABLED", default=False)
7979
FEATURE_SERVICE_DEPENDENCIES_ENABLED = getenv_boolean("FEATURE_SERVICE_DEPENDENCIES_ENABLED", default=False)
80+
# Allow users with legacy role VIEWER to be on call
81+
FEATURE_ALLOW_VIEWERS_ON_CALL = getenv_boolean("FEATURE_ALLOW_VIEWERS_ON_CALL", default=False)
82+
8083

8184
TWILIO_API_KEY_SID = os.environ.get("TWILIO_API_KEY_SID")
8285
TWILIO_API_KEY_SECRET = os.environ.get("TWILIO_API_KEY_SECRET")

0 commit comments

Comments
 (0)