(self, request: Request, workspace_id: str)
| 253 | RoleConstants.WORKSPACE_MANAGE.get_workspace_role() |
| 254 | ) |
| 255 | def put(self, request: Request, workspace_id: str): |
| 256 | id_list = request.data.get('id_list', []) |
| 257 | permitted_ids = check_batch_permissions( |
| 258 | request, id_list, 'tool_id', |
| 259 | (PermissionConstants.TOOL_EDIT.get_workspace_tool_permission(), |
| 260 | PermissionConstants.TOOL_EDIT.get_workspace_permission_workspace_manage_role(), |
| 261 | ViewPermission([RoleConstants.USER.get_workspace_role()], |
| 262 | [PermissionConstants.TOOL.get_workspace_tool_permission()], |
| 263 | CompareConstants.AND), |
| 264 | RoleConstants.WORKSPACE_MANAGE.get_workspace_role()), |
| 265 | workspace_id=workspace_id |
| 266 | ) |
| 267 | |
| 268 | @log(menu='Tool', operate='Batch move tools', |
| 269 | get_operation_object=lambda r, k: get_tool_operation_object_batch(permitted_ids)) |
| 270 | def inner(view, r, **kwargs): |
| 271 | return ToolBatchOperateSerializer( |
| 272 | data={'workspace_id': workspace_id} |
| 273 | ).batch_move({'id_list': permitted_ids, 'folder_id': request.data.get('folder_id')}) |
| 274 | |
| 275 | return result.success(inner(self, request, workspace_id=workspace_id)) |
| 276 | |
| 277 | class Page(APIView): |
| 278 | authentication_classes = [TokenAuth] |
nothing calls this directly
no test coverage detected