Skip to content

Commit 4b4ada8

Browse files
committed
NRL-738 add new perm check
1 parent 57e62d4 commit 4b4ada8

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

layer/nrlf/core/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ class Source(Enum):
3131
CONNECTION_METADATA = "nhsd-connection-metadata"
3232
PERMISSION_AUDIT_DATES_FROM_PAYLOAD = "audit-dates-from-payload"
3333
PERMISSION_SUPERSEDE_IGNORE_DELETE_FAIL = "supersede-ignore-delete-fail"
34+
PERMISSION_ALLOW_ALL_POINTER_TYPES = "allow-all-pointer-types"
35+
3436

3537
PRODUCER_URL_PATH = "/nrl-producer-api/FHIR/R4/DocumentReference"
3638
POINTER_TYPES = {

layer/nrlf/core/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from nrlf.core.authoriser import get_pointer_types
1616
from nrlf.core.codes import SpineErrorConcept
1717
from nrlf.core.config import Config
18-
from nrlf.core.constants import POINTER_TYPES
18+
from nrlf.core.constants import PERMISSION_ALLOW_ALL_POINTER_TYPES, POINTER_TYPES
1919
from nrlf.core.dynamodb.repository import DocumentPointerRepository
2020
from nrlf.core.errors import OperationOutcomeError, ParseError
2121
from nrlf.core.logger import LogReference, logger
@@ -67,7 +67,7 @@ def load_connection_metadata(headers: Dict[str, str], config: Config):
6767
logger.log(LogReference.HANDLER002, headers=headers)
6868
metadata = parse_headers(headers)
6969
logger.log(LogReference.HANDLER003, metadata=metadata.dict())
70-
if metadata.nrl_permissions:
70+
if PERMISSION_ALLOW_ALL_POINTER_TYPES in metadata.nrl_permissions:
7171
logger.log(LogReference.HANDLER004a)
7272
metadata.pointer_types = [
7373
f"http://snomed.info/sct|{key}" for key in list(POINTER_TYPES.keys())

layer/nrlf/core/dynamodb/repository.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,6 @@ def delete_by_id(self, id_: str, can_ignore_delete_fail: bool = False):
430430
stacklevel=5,
431431
error=str(exc),
432432
)
433-
return
434433

435434
def _query(self, **kwargs) -> Iterator[DocumentPointer]:
436435
"""

0 commit comments

Comments
 (0)