Example #1
0
 def decorated_function(*args, **kwargs): # pylint: disable=missing-docstring
     if auth.is_admin():
         return func(*args, **kwargs)
     if not auth.is_logged_in():
         return abort(401)
     return abort(403)
Example #2
0
 def decorated_function(*args, **kwargs): # pylint: disable=missing-docstring
     if auth.is_authorized(ndb.Key(urlsafe=kwargs['key'])):
         return func(*args, **kwargs)
     if not auth.is_logged_in():
         return abort(401)
     return abort(403)