          if getattr(view, '_ignore_model_permissions', False):
              return True
  
          if not request.user or (
             not is_authenticated(request.user) and self.authenticated_users_only):
              return False
  
          queryset = self._queryset(view)
          perms = self.get_required_permissions(request.method, queryset.model)
  
 
</s> remove             is_authenticated(request.user)
 </s> add             request.user.is_authenticated </s> remove     if isinstance(model_field, models.TextField) or (JSONField and isinstance(model_field, JSONField)):
 </s> add     if isinstance(model_field, models.TextField) or (postgres_fields and isinstance(model_field, postgres_fields.JSONField)): </s> remove         return template_render(template, context)
 </s> add         return template.render(context) </s> remove         return request.user and is_authenticated(request.user)
 </s> add         return request.user and request.user.is_authenticated </s> remove     for field in [field for field in opts.fields if field.serialize and not get_remote_field(field)]:
 </s> add     for field in [field for field in opts.fields if field.serialize and not field.remote_field]:
           not request.user.is_authenticated and self.authenticated_users_only):
          if getattr(view, '_ignore_model_permissions', False):
              return True
  
          if not request.user or (
           not request.user.is_authenticated and self.authenticated_users_only):
              return False
  
          queryset = self._queryset(view)
          perms = self.get_required_permissions(request.method, queryset.model)
  
keep keep keep keep replace keep keep keep keep keep
 Remove Django 1.8 & 1.9 compatibility code (#5481)

* Identify code that needs to be pulled out of/removed from compat.py

* Extract modern code from get_names_and_managers in compat.py and remove compat code

* Extract modern code from is_authenticated() in compat.py and remove.

* Extract modern code from is_anonymous() in compat.py and remove

* Extract modern code from get_related_model() from compat.py and remove

* Extract modern code from value_from_object() in compat.py and remove

* Update postgres compat

JSONField now always available.

* Remove DecimalValidator compat

* Remove get_remote_field compat

* Remove template_render compat

Plus isort.

* Remove set_many compat

* Remove include compat 
rest_framework/permissions.py