Example #1
0
 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()
Example #2
0
 def delete_detail(self, object_list, bundle):
     return es_estudiante(bundle.request.user) and bundle.obj.estudiante.usuario == bundle.request.user
Example #3
0
 def create_detail(self, object_list, bundle):
     return es_estudiante(bundle.request.user)
Example #4
0
 def create_list(self, object_list, bundle):
     if es_estudiante(bundle.request.user):
         return object_list
     else:
         raise Unauthorized()