code: def inherits_modelpermissions_serializer(cls):
      
      def is_modelperms():
          return 'ModelPermissionsSerializer' in [
              ser.__name__ for ser in cls.__bases__
          ]
      is_serializer = type(cls).__name__ == 'SerializerMetaclass'
  
      return inspect.isclass(cls) and is_serializer and is_modelperms()
docs: Verify that serializer is a :py:class:`~rest_framework_fine_permissions.serializers.ModelPermissionsSerializer`.