Make only enabled customers able to be removed

This commit is contained in:
Denis Natusch 2023-11-15 01:21:44 +01:00 committed by Simon Bruder
parent bb5e89a83d
commit 02551aa802
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 8 additions and 1 deletions

View file

@ -59,6 +59,10 @@ public class User extends AbstractAggregateRoot<UserIdentifier> {
return id;
}
public boolean isEnabled(){
return userAccount.isEnabled();
}
@Embeddable
public static final class UserIdentifier implements Identifier, Serializable {

View file

@ -23,7 +23,10 @@
<td th:text="${customer.username}">Musterkoch</td>
<td>Aufträge</td>
<td><a th:href="@{/customers/edit/{id}(id=${customer.id})}" class="button">Bearbeiten</a></td>
<td><a th:href="@{/customers/remove/{id}(id=${customer.id})}" class="button">Entfernen</a></td>
<td>
<a th:if="${customer.isEnabled}" th:href="@{/customers/remove/{id}(id=${customer.id})}" class="button">Entfernen</a>
<b th:if="${!customer.isEnabled}">Deaktiviert</b>
</td>
</td>
</tr>
</table>