diff --git a/engine/apps/api/permissions.py b/engine/apps/api/permissions.py index f37d72e9f..2d83b63bf 100644 --- a/engine/apps/api/permissions.py +++ b/engine/apps/api/permissions.py @@ -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( diff --git a/engine/settings/base.py b/engine/settings/base.py index 007779f19..769f66cde 100644 --- a/engine/settings/base.py +++ b/engine/settings/base.py @@ -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")