Make the rspamd webui available, fixes #157

This commit is contained in:
kaiyou
2017-11-10 14:49:36 +01:00
parent 3675fdb915
commit 1a3f85fbc2
4 changed files with 38 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ from mailu import db, models, app, limiter
from mailu.internal import internal, nginx
import flask
import flask_login
@internal.route("/auth/email")
@@ -17,3 +18,13 @@ def nginx_authentication():
for key, value in headers.items():
response.headers[key] = str(value)
return response
@internal.route("/auth/admin")
def admin_authentication():
""" Fails if the user is not an authenticated admin.
"""
if (not flask_login.current_user.is_anonymous
and flask_login.current_user.global_admin):
return ""
return flask.abort(403)