mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-30 18:13:23 +08:00
Merge pull request #17161 from jozh2008/dev
Don't require admin user to list ``/api/tool_data``
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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."""
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user