Merge pull request #17161 from jozh2008/dev

Don't require admin user to list ``/api/tool_data``
This commit is contained in:
Marius van den Beek
2023-12-11 19:58:07 +01:00
committed by GitHub
3 changed files with 2 additions and 14 deletions
-12
View File
@@ -18264,12 +18264,6 @@ export interface operations {
* Lists all available data tables
* @description Get the list of all available data tables.
*/
parameters?: {
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
header?: {
"run-as"?: string;
};
};
responses: {
/** @description A list with details on individual data tables. */
200: {
@@ -18277,12 +18271,6 @@ export interface operations {
"application/json": components["schemas"]["ToolDataEntryList"];
};
};
/** @description Validation Error */
422: {
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
create_api_tool_data_post: {
+1 -1
View File
@@ -54,7 +54,7 @@ class FastAPIToolData:
"/api/tool_data",
summary="Lists all available data tables",
response_description="A list with details on individual data tables.",
require_admin=True,
require_admin=False,
)
async def index(self) -> ToolDataEntryList:
"""Get the list of all available data tables."""
+1 -1
View File
@@ -14,7 +14,7 @@ from ._framework import ApiTestCase
class TestToolDataApi(ApiTestCase):
def test_admin_only(self):
index_response = self._get("tool_data", admin=False)
self._assert_status_code_is(index_response, 403)
self._assert_status_code_is(index_response, 200)
def test_list(self):
index_response = self._get("tool_data", admin=True)