From f2b0d9caab1f106d6fe604cca8207875ba0df575 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 6 Jun 2024 14:50:32 -0500 Subject: Add deprecation warning to /group-privileges endpoint function. --- gn_auth/auth/authorisation/resources/groups/views.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gn_auth/auth') 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__))) -- cgit v1.2.3