示例#1
0
 def decorator(*args, **kwargs):
     user = flask_login.current_user
     if not all(user.can(perm) for perm in permissions):
         return render_queue('error.html',
             message='Permission Denied.',
             action='Home',
             url=url_for('queue.home'))
     return f(*args, **kwargs)
示例#2
0
文件: views.py 项目: alvinwan/quupod
def render_admin(template: str, *args, **context) -> str:
    """Special rendering for queue admin."""
    return render_queue(template, *args, **context)