docs: def has_publish_permission(self, request, obj=None):
          """
          Determines if the user has permissions to publish.
  
          :param request: Django request object.
          :param obj: The object to determine if the user has
          permissions to publish.
          :return: Boolean.
          """
          # If auto-publishing is enabled, no user has "permission" to publish
          # because it happens automatically
          if is_automatic_publishing_enabled(self.model):
              return False
          user_obj = request.user
          if not user_obj.is_active:
              return False
          if user_obj.is_superuser:
              return True
          # Normal user with `can_publish` permission can always publish
          if user_obj.has_perm('%s.can_publish' % self.opts.app_label):
              return True
          # Normal user with `can_republish` permission can only publish if the
          # item is already published.
          if user_obj.has_perm('%s.can_republish' % self.opts.app_label) and \
                  obj and getattr(obj, 'has_been_published', False):
              return True
          # User does not meet any publishing permisison requirements; reject!
          return False