master
Aevann1 2022-01-07 22:48:49 +02:00
parent 384aaf9b66
commit b1e9e03016
1 changed files with 6 additions and 3 deletions

View File

@ -38,6 +38,7 @@ def auth_desired(f):
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
v = get_logged_in_user() v = get_logged_in_user()
g.v = v
check_ban_evade(v) check_ban_evade(v)
@ -53,9 +54,9 @@ def auth_required(f):
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
v = get_logged_in_user() v = get_logged_in_user()
if not v: abort(401) if not v: abort(401)
g.v = v
check_ban_evade(v) check_ban_evade(v)
resp = make_response(f(*args, v=v, **kwargs)) resp = make_response(f(*args, v=v, **kwargs))
@ -72,7 +73,8 @@ def is_not_permabanned(f):
v = get_logged_in_user() v = get_logged_in_user()
if not v: abort(401) if not v: abort(401)
g.v = v
check_ban_evade(v) check_ban_evade(v)
if v.is_banned and v.unban_utc == 0: if v.is_banned and v.unban_utc == 0:
@ -96,7 +98,8 @@ def admin_level_required(x):
if not v: abort(401) if not v: abort(401)
if v.admin_level < x: abort(403) if v.admin_level < x: abort(403)
g.v = v
response = f(*args, v=v, **kwargs) response = f(*args, v=v, **kwargs)
if isinstance(response, tuple): resp = make_response(response[0]) if isinstance(response, tuple): resp = make_response(response[0])