Skip to content

Commit e77f82a

Browse files
[PRMP-1184] Adjust DocumentStatus endpoint auth
1 parent c308374 commit e77f82a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lambdas/services/authoriser_service.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,7 @@ def deny_access_policy(self, path, user_role, nhs_number: str = None):
121121
deny_resource = False
122122

123123
case "/DocumentStatus":
124-
deny_resource = (
125-
not patient_access_is_allowed or is_user_gp_clinical or is_user_pcse
126-
)
124+
deny_resource = not patient_access_is_allowed
127125

128126
case path if re.match(r"^/DocumentReview/[^/]+/[^/]+/Status$", path):
129127
deny_resource = False

lambdas/tests/unit/services/test_authoriser_service.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ def mocked_decode_method(auth_token: str, *_args, **_kwargs):
7474
[
7575
"/DocumentManifest",
7676
"/DocumentDelete",
77-
"/DocumentStatus",
7877
"/UploadState",
7978
"/VirusScan",
80-
8179
],
8280
)
8381
def test_deny_access_policy_returns_true_for_gp_clinical_on_paths(
@@ -92,7 +90,7 @@ def test_deny_access_policy_returns_true_for_gp_clinical_on_paths(
9290
assert actual == expected
9391

9492

95-
@pytest.mark.parametrize("test_path", ["/DocumentManifest", "/DocumentDelete", "Any"])
93+
@pytest.mark.parametrize("test_path", ["/DocumentManifest", "/DocumentDelete", "/DocumentStatus", "Any"])
9694
def test_deny_access_policy_returns_true_for_nhs_number_not_in_allowed(
9795
test_path,
9896
mock_auth_service: AuthoriserService,

0 commit comments

Comments
 (0)