mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
10 lines
274 B
10 lines
274 B
from rest_framework.permissions import BasePermission
|
|
|
|
|
|
class IsOwnComment(BasePermission):
|
|
@classmethod
|
|
def has_object_permission(cls, request, view, obj):
|
|
if request.user.is_superuser:
|
|
return True
|
|
|
|
return obj.user.id == request.user.id
|