summaryrefslogtreecommitdiff
path: root/src/main/resources/templates/fragments.html
diff options
context:
space:
mode:
authorPaul-Christian Volkmer2024-01-11 13:09:55 +0100
committerPaul-Christian Volkmer2024-01-11 13:29:33 +0100
commit8a11e6e85b2b2cb4f860ddca010386cb3f701f9b (patch)
treee5e21d21cba3f6d5845b185bce26a5d80e126b42 /src/main/resources/templates/fragments.html
parent5579ad14534111db6954b772ccd0ea72a09e4c15 (diff)
feat #18: initial support for authentication
Diffstat (limited to 'src/main/resources/templates/fragments.html')
-rw-r--r--src/main/resources/templates/fragments.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/resources/templates/fragments.html b/src/main/resources/templates/fragments.html
index 677e841..7a9af2f 100644
--- a/src/main/resources/templates/fragments.html
+++ b/src/main/resources/templates/fragments.html
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html xmlns:th="http://www.thymeleaf.org">
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" th:href="@{/style.css}" />
@@ -14,7 +14,15 @@
<ul>
<li><a th:href="@{/}">Übersicht</a></li>
<li><a th:href="@{/statistics}">Statistiken</a></li>
- <li><a th:href="@{/configs}">Konfiguration</a></li>
+ <li sec:authorize="hasRole('ADMIN')">
+ <a th:href="@{/configs}">Konfiguration</a>
+ </li>
+ <li class="login" sec:authorize="not isAuthenticated()">
+ <a th:href="@{/login}">Login</a>
+ </li>
+ <li class="login" sec:authorize="isAuthenticated()">
+ <a th:href="@{/logout}">Abmelden</a>
+ </li>
</ul>
</nav>
</div>