Пример #1
0
 def _inner(request, *args, **kwargs):
     user = request.user
     if ((IS_CONTRACTOR.enabled(user.username) or user.is_superuser)
             and not is_request_using_sso(request)):
         return view_func(request, *args, **kwargs)
     else:
         return HttpResponseRedirect(reverse("no_permissions"))
Пример #2
0
def is_superuser_or_contractor(user: CouchUser):
    return IS_CONTRACTOR.enabled(user.username) or user.is_superuser
Пример #3
0
 def _permission_check(couch_user, domain):
     return (
         couch_user.is_superuser or
         IS_CONTRACTOR.enabled(couch_user.username)
     )
Пример #4
0
 def _permission_check(couch_user, domain):
     return (
         couch_user.is_superuser or
         IS_CONTRACTOR.enabled(couch_user.username)
     )
Пример #5
0
 def _inner(request, *args, **kwargs):
     user = request.user
     if IS_CONTRACTOR.enabled(user.username) or user.is_superuser:
         return view_func(request, *args, **kwargs)
     else:
         return HttpResponseRedirect(reverse("no_permissions"))