From 6bca1acf49b56f7f86370e4ed4b7298f700ef2f1 Mon Sep 17 00:00:00 2001 From: Maria Khrustaleva Date: Tue, 5 Mar 2024 15:08:52 +0100 Subject: [PATCH] Fixed scope defining when checking status of project import --- ...ia_fix_scope_defining_when_checking_project_permissions.md | 4 ++++ cvat/apps/iam/permissions.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20240306_133305_maria_fix_scope_defining_when_checking_project_permissions.md diff --git a/changelog.d/20240306_133305_maria_fix_scope_defining_when_checking_project_permissions.md b/changelog.d/20240306_133305_maria_fix_scope_defining_when_checking_project_permissions.md new file mode 100644 index 000000000000..b92b665a4752 --- /dev/null +++ b/changelog.d/20240306_133305_maria_fix_scope_defining_when_checking_project_permissions.md @@ -0,0 +1,4 @@ +### Fixed + +- Scope definition when checking project permissions while requesting status of project import + () diff --git a/cvat/apps/iam/permissions.py b/cvat/apps/iam/permissions.py index 10fa069da5e9..90cf771b60ac 100644 --- a/cvat/apps/iam/permissions.py +++ b/cvat/apps/iam/permissions.py @@ -754,7 +754,7 @@ def get_scopes(request, view, obj): ('append_dataset_chunk', 'HEAD'): Scopes.IMPORT_DATASET, ('append_dataset_chunk', 'PATCH'): Scopes.IMPORT_DATASET, ('annotations', 'GET'): Scopes.EXPORT_ANNOTATIONS, - ('dataset', 'GET'): Scopes.EXPORT_DATASET, + ('dataset', 'GET'): Scopes.IMPORT_DATASET if request.query_params.get('action') == 'import_status' else Scopes.EXPORT_DATASET, ('export_backup', 'GET'): Scopes.EXPORT_BACKUP, ('import_backup', 'POST'): Scopes.IMPORT_BACKUP, ('append_backup_chunk', 'PATCH'): Scopes.IMPORT_BACKUP,