(self, request: Request, workspace_id: str)
| 215 | RoleConstants.WORKSPACE_MANAGE.get_workspace_role() |
| 216 | ) |
| 217 | def put(self, request: Request, workspace_id: str): |
| 218 | id_list = request.data.get('id_list', []) |
| 219 | permitted_ids = check_batch_permissions( |
| 220 | request, id_list, 'tool_id', |
| 221 | (PermissionConstants.TOOL_DELETE.get_workspace_tool_permission(), |
| 222 | PermissionConstants.TOOL_DELETE.get_workspace_permission_workspace_manage_role(), |
| 223 | ViewPermission([RoleConstants.USER.get_workspace_role()], |
| 224 | [PermissionConstants.TOOL.get_workspace_tool_permission()], |
| 225 | CompareConstants.AND), |
| 226 | RoleConstants.WORKSPACE_MANAGE.get_workspace_role()), workspace_id=workspace_id |
| 227 | ) |
| 228 | |
| 229 | @log(menu='Tool', operate='Batch delete tools', |
| 230 | get_operation_object=lambda r, k: get_tool_operation_object_batch(permitted_ids)) |
| 231 | def inner(view, r, **kwargs): |
| 232 | return ToolBatchOperateSerializer( |
| 233 | data={'workspace_id': workspace_id} |
| 234 | ).batch_delete({'id_list': permitted_ids}) |
| 235 | |
| 236 | return result.success(inner(self, request, workspace_id=workspace_id)) |
| 237 | |
| 238 | class BatchMove(APIView): |
| 239 | authentication_classes = [TokenAuth] |
nothing calls this directly
no test coverage detected