diff --git a/src/model/user.rs b/src/model/user.rs index 00d66a6..9ae4a3d 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -753,7 +753,7 @@ impl<'r> FromRequest<'r> for AdminUser { if user.has_role(db, "admin").await { Outcome::Success(AdminUser { user }) } else { - Outcome::Error((Status::Forbidden, LoginError::NotACox)) + Outcome::Forward(Status::Forbidden) } } Outcome::Error(f) => Outcome::Error(f), diff --git a/templates/log.completed.html.tera b/templates/log.completed.html.tera index 2568f5d..1edaefa 100644 --- a/templates/log.completed.html.tera +++ b/templates/log.completed.html.tera @@ -3,7 +3,16 @@ {% extends "base" %} {% block content %}
-

Logbuch

+

+ Logbuch + {% if "admin" in loggedin_user.roles %} + + {% endif %} +

@@ -17,4 +26,32 @@ {% for log in logs %}{{ log::show_old(log=log, state="completed", only_ones=false, index=loop.index) }}{% endfor %}
+ {% endblock content %}