Пример #1
0
 def has_permission(self, request, view):
     if request.method == "POST":
         return iup.has_object_creation_permission(request,
                                                   cfs.CupFightSerializer,
                                                   "cup_phase",
                                                   cpm.CupPhase)
     return True
Пример #2
0
 def has_permission(self, request, view):
     if request.method == "POST":
         return ip.has_object_creation_permission(request,
                                                  fs.FightSerializer,
                                                  "team_fight",
                                                  tfm.TeamFight)
     return True
Пример #3
0
 def has_permission(self, request, view):
     if request.method == "POST":
         return iup.has_object_creation_permission(
             request=request,
             serializer_class=gfs.GroupFightSerializer,
             tournament_dependent_class_field="group",
             tournament_dependent_class=gm.Group,
             getter_fcn=self.get_tournament)
     return True
Пример #4
0
 def has_permission(self, request, view):
     if request.method == "POST":
         if "pk" in view.kwargs:
             try:
                 group = gm.Group.objects.get(pk=view.kwargs["pk"])
                 return iup.is_user_admin_of_the_tournament(
                     request, group.group_phase.tournament)
             except gm.Group.DoesNotExist:
                 return False
         return iup.has_object_creation_permission(request,
                                                   gs.GroupSerializer,
                                                   "group_phase",
                                                   gpm.GroupPhase)
     return True
Пример #5
0
 def has_permission(self, request, view):
     if request.method == "POST":
         return ip.has_object_creation_permission(
             request, pts.PointSerializer, "fight",
             ippon.models.fight.Fight, ip.get_tournament_from_fight)
     return True