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,