get_streams: Return metadata access streams in include_all.

This parameter is no longer restricted to realm administrators. Any
user can get the streams they have metadata access to by setting this
parameter to true.
This commit is contained in:
Shubham Padia
2025-02-25 08:50:48 +00:00
committed by Tim Abbott
parent 23bbaf0578
commit a80b2e478c
5 changed files with 201 additions and 49 deletions

View File

@@ -826,12 +826,6 @@ def get_user_groups(client: Client) -> int:
return leadership_user_group["id"]
def test_user_not_authorized_error(nonadmin_client: Client) -> None:
result = nonadmin_client.get_streams(include_all=True)
assert_error_response(result)
validate_against_openapi_schema(result, "/rest-error-handling", "post", "400")
@openapi_test_function("/streams/{stream_id}/members:get")
def get_subscribers(client: Client) -> None:
user_ids = [11, 25]
@@ -1881,7 +1875,6 @@ def test_streams(client: Client, nonadmin_client: Client) -> None:
add_default_stream(client)
remove_default_stream(client)
test_user_not_authorized_error(nonadmin_client)
test_authorization_errors_fatal(client, nonadmin_client)

View File

@@ -20548,23 +20548,6 @@ paths:
},
],
}
"400":
description: Bad request.
content:
application/json:
schema:
allOf:
- $ref: "#/components/schemas/CodedError"
- example:
{
"code": "BAD_REQUEST",
"msg": "User not authorized for this query",
"result": "error",
}
description: |
An example JSON response for when the user is not authorized to use the
`include_all` parameter (i.e. because they are not an organization
administrator):
/streams/{stream_id}:
get:
operationId: get-stream-by-id