aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-06-17 15:54:34 -0500
committerFrederick Muriuki Muriithi2024-06-17 15:54:34 -0500
commit96bfa61529f543899a4599c824a3b27676e5118b (patch)
treec2a5b48d473439c48dbc566681144de6e555568e
parent529165c1fda8b7f88bcc4fff4f227d95c7bf6ba5 (diff)
downloadgn-auth-96bfa61529f543899a4599c824a3b27676e5118b.tar.gz
Remove deprecated endpoint.
-rw-r--r--gn_auth/auth/authorisation/resources/groups/views.py28
1 files changed, 0 insertions, 28 deletions
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")