Skip to content

Commit 8ff73e2

Browse files
NRL-2015 option 4 propsed changes
1 parent 1c5c062 commit 8ff73e2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

layer/nrlf/core/decorators.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,17 @@ def wrapper(*args, **kwargs) -> Dict[str, Any]:
147147

148148
def _use_v2_permissions_model(headers: Dict[str, str]) -> bool:
149149
case_insensitive_headers = {key.lower(): value for key, value in headers.items()}
150-
# if either or both headers are missing
151-
return (
152-
CLIENT_RP_DETAILS not in case_insensitive_headers.keys()
153-
or CONNECTION_METADATA not in case_insensitive_headers.keys()
150+
151+
v1_headers_provided = (
152+
CLIENT_RP_DETAILS in case_insensitive_headers.keys()
153+
and CONNECTION_METADATA in case_insensitive_headers.keys()
154154
)
155+
if v1_headers_provided:
156+
return False
157+
158+
v2_permissions_configured = get_pointer_permissions_v2() != {}
159+
160+
return v2_permissions_configured
155161

156162

157163
def _load_v2_connection_metadata(headers: Dict[str, str], path: str):

0 commit comments

Comments
 (0)