code: def is_resource_protected(self, request, **kwargs):
          
          access_state = self._get_resource_access_state(request)
          protected_states = self.get_protected_states()
          return access_state in protected_states
docs: Determines if a resource should be protected.
  
          Returns true if and only if the resource's access_state matches an entry in
          the return value of get_protected_states().