Пример #1
0
    def has_permission(self, request, view):
        if request.method in SAFE_METHODS:
            return True

        if request.method in ("POST", ):
            return check_permission_from_post_data(request,
                                                   "administration",
                                                   allow_staff=True)

        return True
Пример #2
0
    def has_permission(self, request, view):
        if request.method in ("POST", ):
            return check_permission_from_post_data(request, "event")

        return True
Пример #3
0
 def has_permission(self, request, view):
     return request.method != "POST" or check_permission_from_post_data(
         request, "election")