code: def attribute_is_visible(self, permission):
          
          try:
              parent = getattr(self, "parent_{}".format(permission))
              student = getattr(self, "self_{}".format(permission))
              return (parent and student) or (self.is_http_request_sender() or self._current_user_override())
          except Exception:
              logger.error("Could not retrieve permissions for {}".format(permission))
docs: Checks privacy options to see if an attribute is visible to public