From 02eba10b45615b9c5e3fe36c34865f20de1a34bc Mon Sep 17 00:00:00 2001 From: Boris Sekachev Date: Wed, 2 Nov 2022 06:16:13 +0200 Subject: [PATCH] Fixed issue: cannot assign a resource to a user who has an organization (#5218) --- CHANGELOG.md | 1 + cvat-core/package.json | 2 +- cvat-core/src/server-proxy.ts | 10 +++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 223e1ffe..f37cf7d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,6 +63,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428) - Changing an object causes current z layer to be set to the maximum () - Job assignee can not resolve an issue () - Create manifest with cvat/server docker container command () +- Cannot assign a resource to a user who has an organization () ### Security - TDB diff --git a/cvat-core/package.json b/cvat-core/package.json index 8683d123..8871826b 100644 --- a/cvat-core/package.json +++ b/cvat-core/package.json @@ -1,6 +1,6 @@ { "name": "cvat-core", - "version": "7.0.2", + "version": "7.0.3", "description": "Part of Computer Vision Tool which presents an interface for client-side integration", "main": "src/api.ts", "scripts": { diff --git a/cvat-core/src/server-proxy.ts b/cvat-core/src/server-proxy.ts index 037c26ab..aef9961f 100644 --- a/cvat-core/src/server-proxy.ts +++ b/cvat-core/src/server-proxy.ts @@ -216,7 +216,15 @@ class ServerProxy { return reqConfig; } - reqConfig.params = { ...enableOrganization(), ...(reqConfig.params || {}) }; + const organization = enableOrganization(); + // for users when organization is unset + // we are interested in getting all the users, + // not only those who are not in any organization + if (reqConfig.url.endsWith('/users') && !organization.org) { + return reqConfig; + } + + reqConfig.params = { ...organization, ...(reqConfig.params || {}) }; return reqConfig; });