Make the rspamd webui available, fixes #157
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user