aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-06-06 14:50:32 -0500
committerFrederick Muriuki Muriithi2024-06-06 14:50:32 -0500
commitf2b0d9caab1f106d6fe604cca8207875ba0df575 (patch)
treedcefe294d495992443dc5fcf10acb1ba6b380594
parentf84168a6da47e97968160a778d614137e7a126a7 (diff)
downloadgn-auth-f2b0d9caab1f106d6fe604cca8207875ba0df575.tar.gz
Add deprecation warning to /group-privileges endpoint function.
-rw-r--r--gn_auth/auth/authorisation/resources/groups/views.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/gn_auth/auth/authorisation/resources/groups/views.py b/gn_auth/auth/authorisation/resources/groups/views.py
index f85809c..fb1a831 100644
--- a/gn_auth/auth/authorisation/resources/groups/views.py
+++ b/gn_auth/auth/authorisation/resources/groups/views.py
@@ -3,6 +3,7 @@ The views/routes for the `gn3.auth.authorisation.resources.groups` package.
"""
import uuid
import datetime
+import warnings
from typing import Iterable
from functools import partial
from dataclasses import asdict
@@ -330,6 +331,10 @@ def group_privileges():
return tuple(
privilege for arole in this_user_roles["roles"]
for privilege in arole.privileges) + group_level_roles #type: ignore[attr-defined]
+ warnings.warn(
+ (f"The `{__name__}.group_privileges` function is broken and will "
+ "be deleted."),
+ PendingDeprecationWarning)
return jsonify(tuple(
asdict(priv) for priv in with_db_connection(__list_privileges__)))