Added new quizz button and role

This commit is contained in:
2025-06-13 19:46:26 +02:00
parent 225b5df774
commit 08262f3dfd
7 changed files with 42 additions and 16 deletions
@@ -0,0 +1,8 @@
alter table role_privileges drop constraint role_privileges_privileges_check;
alter table role_privileges add constraint role_privileges_privileges_check
check (privileges in ('LIST_USERS','ADD_USERS','LIST_QUIZZ','CREATE_QUIZZ','VIEW_ALL_FORMS'));
insert into role_privileges VALUES
((select id from roles where "name" = 'ADMIN'),'CREATE_QUIZZ');
insert into role_privileges VALUES
((select id from roles where "name" = 'ADMIN'),'VIEW_ALL_FORMS');
+1
View File
@@ -17,6 +17,7 @@
<li th:if="${#lists.isEmpty(editableQuizz)}">Aucun quizz de disponible malheureusement :(</li>
<li th:each="q : ${editableQuizz}"><a th:href="@{/questions/quizz-edit/{id}(id=${q.id})}">Quizz <span th:text="${q.name}"/></a></li>
</ul>
<a sec:authorize="hasAuthority('CREATE_QUIZZ')" th:href="@{/questions/new-quizz}">Nouveau Quizz</a>
</main>
</body>
</html>