I would like to serialize object level permission - and send a simple True or False to the browser - so accordingly I trigger the "allow editing" code.
I am doing this so the user does not have functionality presented to them that they cannot use.
Is there a built in way to do this? The docs do not allude to this.
I have attempted the following on the serializer:
has_permission = serializers.SerializerMethodField('check_permission')
def check_permission(self, obj):
return self.check_object_permissions(self.request, obj)but the serializer does not have the method check_object_permissions - that belongs to the permission object.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.