def to_representation(self, instance):
    """ Apply field level security by removing fields for unauthorized users"""
representation = super(ProductSerializer, self).to_representation(instance)
if not permission_granted:
    remove_fields = 'classification',
self.remove_fields_from_representation(representation, remove_fields)
return representation
Django REST Framework — Сериализация необязательных полей