From 449ae0c5bfa0cdc84e2cbff72eede181f5f3aaa6 Mon Sep 17 00:00:00 2001
From: Kiwon Jung <jelsominaa@gmail.com>
Date: Fri, 25 Mar 2022 20:21:37 +0900
Subject: [PATCH] fixed: Unable to upload annotations #4459 (#4513)

---
 CHANGELOG.md                 |  5 +++--
 cvat/apps/iam/permissions.py | 10 ++++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index fceccd4714ae..44de0ac2f34d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,9 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - TDB
 
 ### Fixed
-- Permission error occured when accessing the JobCommits (<https://github.com/openvinotoolkit/cvat/issues/4434>)
-- job assignee can remove or update any issue created by the task owner (<https://github.com/openvinotoolkit/cvat/issues/4424>)
+- Permission error occured when accessing the JobCommits (<https://github.com/openvinotoolkit/cvat/pull/4435>)
+- job assignee can remove or update any issue created by the task owner (<https://github.com/openvinotoolkit/cvat/pull/4436>)
 - Bug: Incorrect point deletion with keyboard shortcut (<https://github.com/openvinotoolkit/cvat/pull/4420>)
+- Unable to upload annotations (<https://github.com/openvinotoolkit/cvat/pull/4513>)
 
 ### Security
 - TDB
diff --git a/cvat/apps/iam/permissions.py b/cvat/apps/iam/permissions.py
index 022a5cc466b0..5eb26a7bf8e3 100644
--- a/cvat/apps/iam/permissions.py
+++ b/cvat/apps/iam/permissions.py
@@ -645,12 +645,15 @@ def get_scopes(request, view, obj):
             ('annotations', 'PATCH'): 'update:annotations',
             ('annotations', 'DELETE'): 'delete:annotations',
             ('annotations', 'PUT'): 'update:annotations',
+            ('annotations', 'POST'): 'import:annotations',
+            ('append_annotations_chunk', 'PATCH'): 'update:annotations',
+            ('append_annotations_chunk', 'HEAD'): 'update:annotations',
             ('dataset_export', 'GET'): 'export:dataset',
             ('data', 'GET'): 'view:data',
             ('data_info', 'GET'): 'view:data',
             ('data', 'POST'): 'upload:data',
-            ('append_tus_chunk', 'PATCH'): 'upload:data',
-            ('append_tus_chunk', 'HEAD'): 'upload:data',
+            ('append_data_chunk', 'PATCH'): 'upload:data',
+            ('append_data_chunk', 'HEAD'): 'upload:data',
             ('jobs', 'GET'): 'view',
             ('import_backup', 'POST'): 'import:backup',
             ('export_backup', 'GET'): 'export:backup',
@@ -790,6 +793,9 @@ def get_scopes(request, view, obj):
             ('annotations', 'PATCH'): 'update:annotations',
             ('annotations', 'DELETE'): 'delete:annotations',
             ('annotations', 'PUT'): 'update:annotations',
+            ('annotations', 'POST'): 'import:annotations',
+            ('append_annotations_chunk', 'PATCH'): 'update:annotations',
+            ('append_annotations_chunk', 'HEAD'): 'update:annotations',
             ('data', 'GET'): 'view:data',
             ('issues', 'GET'): 'view',
             ('commits', 'GET'): 'view:commits'