def can_write_foirequest(foirequest, request): if can_write_object(foirequest, request): return True if foirequest.project: return can_write_foiproject(foirequest.project, request) return False
def has_object_permission(self, request, view, obj): if can_write_object(obj, request): return True if request.method in permissions.SAFE_METHODS and hasattr(obj, 'public'): return obj.public return False
def can_write_foiproject(foiproject, request): return can_write_object(foiproject, request)
def can_write(self, request): return can_write_object(self, request=request)