From 96bfa61529f543899a4599c824a3b27676e5118b Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 17 Jun 2024 15:54:34 -0500 Subject: Remove deprecated endpoint. --- .../auth/authorisation/resources/groups/views.py | 28 ---------------------- 1 file changed, 28 deletions(-) (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 f22e15d..73ba3bd 100644 --- a/gn_auth/auth/authorisation/resources/groups/views.py +++ b/gn_auth/auth/authorisation/resources/groups/views.py @@ -281,34 +281,6 @@ def link_data() -> Response: return jsonify(with_db_connection(__link__)) -@groups.route("/privileges", methods=["GET"]) -@require_oauth("profile group") -def group_privileges(): - """Return a list of all available group roles.""" - with require_oauth.acquire("profile group role") as the_token: - def __list_privileges__(conn: db.DbConnection) -> Iterable[Privilege]: - ## TODO: Check that user has appropriate privileges - this_user_roles = user_roles(conn, the_token.user) - with db.cursor(conn) as cursor: - cursor.execute("SELECT * FROM privileges " - "WHERE privilege_id LIKE 'group:%'") - group_level_roles = tuple( - Privilege(row["privilege_id"], row["privilege_description"]) - for row in cursor.fetchall()) - - ## the `user_roles(...)` function changed thus this entire function - ## needs to change or be obsoleted -- also remove the ignore below - 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__))) - - @groups.route("/role/create", methods=["POST"]) @require_oauth("profile group") -- cgit v1.2.3