- Добавил возможность назначения ролей пользователям.
- Добавил контроллер для управления пользователями и запрет доступа к нему пользователям без роли ADMIN. https://www.youtube.com/watch?v=6dteOGWy4uk&list=PLU2ftbIeotGpAYRP9Iv2KLIwK36-o_qYk&index=9 Использовал аннотацию @EnableMethodSecurity вместо deprecated @EnableGlobalMethodSecurity
This commit is contained in:
23
src/main/resources/templates/userList.ftl
Normal file
23
src/main/resources/templates/userList.ftl
Normal file
@@ -0,0 +1,23 @@
|
||||
<#import "parts/common.ftl" as com>
|
||||
<@com.page>
|
||||
<div>Users</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Role</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<#list users as user>
|
||||
<tr>
|
||||
<td>${user.username}</td>
|
||||
<td><#list user.roles as role>${role}<#sep>, </#list></td>
|
||||
<td><a href="/users/${user.id}">edit</a></td>
|
||||
</tr>
|
||||
</#list>
|
||||
</tbody>
|
||||
</table>
|
||||
<a href="/main">Main page</a>
|
||||
</@com.page>
|
||||
Reference in New Issue
Block a user