Skip to content

Commit 3f54e8e

Browse files
committed
Annotators can list IdentificationTask (filtered)
1 parent 22d07c8 commit 3f54e8e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

api/permissions.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,16 @@ def has_object_permission(self, request, view, obj):
221221
return request.user.has_perms(perms)
222222

223223
class IdentificationTaskPermissions(BaseIdentificationTaskPermissions):
224-
pass
224+
def has_permission(self, request, view):
225+
role_perm = False
226+
if view.action == 'list':
227+
role_perm = UserRolePermission().check_permissions(
228+
user=request.user,
229+
action='add',
230+
obj_or_klass=ExpertReportAnnotation
231+
)
232+
233+
return super().has_permission(request, view) or role_perm
225234

226235
class MyIdentificationTaskPermissions(DjangoRegularUserModelPermissions):
227236
pass

0 commit comments

Comments
 (0)