Пример #1
0
 def checker(request, obj):
     identity = who.get_identity(request)
     if not identity or not identity.is_admin():
         raise GuardError("Need admin permissions")
Пример #2
0
 def checker(request, obj):
     if who.get_identity(request) is None:
         raise GuardError("Not logged in")