From 47768f01fc5953270a4e1abfa6e9d315546dcd15 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Wed, 7 Feb 2024 10:55:38 +0100 Subject: [PATCH] let mobile app use escalation options endpoints (#3847) # What this PR does ## Which issue(s) this PR fixes ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --- CHANGELOG.md | 6 ++++++ engine/apps/api/views/escalation_policy.py | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5005f4b1..e8768699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Allow mobile app to access escalation options endpoints @imtoori ([#3847](https://github.com/grafana/oncall/pull/3847)) + ## v1.3.102 (2024-02-06) ### Fixed diff --git a/engine/apps/api/views/escalation_policy.py b/engine/apps/api/views/escalation_policy.py index afe92c8c..47bcbe2f 100644 --- a/engine/apps/api/views/escalation_policy.py +++ b/engine/apps/api/views/escalation_policy.py @@ -12,6 +12,7 @@ from apps.api.serializers.escalation_policy import ( EscalationPolicyUpdateSerializer, ) from apps.auth_token.auth import PluginAuthentication +from apps.mobile_app.auth import MobileAppAuthTokenAuthentication from common.api_helpers.mixins import ( CreateSerializerMixin, PublicPrimaryKeyMixin, @@ -29,7 +30,10 @@ class EscalationPolicyView( UpdateSerializerMixin, OrderedModelViewSet, ): - authentication_classes = (PluginAuthentication,) + authentication_classes = ( + MobileAppAuthTokenAuthentication, + PluginAuthentication, + ) permission_classes = (IsAuthenticated, RBACPermission) rbac_permissions = { "metadata": [RBACPermission.Permissions.ESCALATION_CHAINS_READ],