Skip to content

Commit a9f8108

Browse files
Remove unneeded permission
1 parent a502165 commit a9f8108

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

backend/annotation/views.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ def has_permission(self, request, view):
3737
if user.is_superuser:
3838
return True
3939

40-
return user.has_perm("annotation.add_labelannotation") or user.has_perm(
41-
"annotation.change_labelannotation"
42-
)
40+
return user.has_perm("annotation.add_labelannotation")
4341

4442

4543
class LabelAnnotationView(ModelViewSet):
@@ -126,7 +124,7 @@ def _update_label_annotations(
126124
def _mark_as_removed(self, label_annotation: LabelAnnotation, user: User) -> None:
127125
"""Mark a label annotation as removed."""
128126

129-
if not user.can_remove_label(label_annotation):
127+
if not user.can_remove_label_annotation(label_annotation):
130128
logger.warning(
131129
f"User {user.username} attempted to remove label {label_annotation.label.pk} "
132130
f"attached by {label_annotation.created_by.username}"

backend/user/permissions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
("problem", "view_silver_problems"),
44
("annotation", "change_knowledgebaseannotation"),
55
("annotation", "add_labelannotation"),
6-
("annotation", "change_labelannotation"),
76
("annotation", "delete_own_labelannotation"),
87
]
98

0 commit comments

Comments
 (0)