def decorated_view(*args, **kwargs): if not is_super_user(g.user['user_id']): flash(u'Only super users can access this feature', 'error') return redirect(url_for('index.show_home')) return f(*args, **kwargs)
def jinja_super_user_check(user_id): return is_super_user(user_id)