def delete_list(self, object_list, bundle): if es_estudiante(bundle.request.user): allowed = [] for obj in object_list: if obj.estudiante.usuario == bundle.request.user: allowed.append(obj) return allowed else: raise Unauthorized()
def delete_detail(self, object_list, bundle): return es_estudiante(bundle.request.user) and bundle.obj.estudiante.usuario == bundle.request.user
def create_detail(self, object_list, bundle): return es_estudiante(bundle.request.user)
def create_list(self, object_list, bundle): if es_estudiante(bundle.request.user): return object_list else: raise Unauthorized()