diff --git a/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java b/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java index 0778006..9e1fe3f 100755 --- a/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java @@ -438,10 +438,6 @@ public class PermissionManager implements UserDataProvider { permission.setStarts(permissionStarts); permission.setExpires(permissionsExpires); } else { - if (permission.getStarts() != null && permission.getStarts().isBefore(Instant.now())) { - permission.setStarts(null); - } - if (permission.getExpires().isBefore(Instant.now())) { permission.setExpires(Instant.now()); } @@ -450,6 +446,10 @@ public class PermissionManager implements UserDataProvider { permissionMapping.getLifetimeUnit())); } + if (permission.getStarts() != null && permission.getStarts().isBefore(Instant.now())) { + permission.setStarts(null); + } + if (permissionMapping.isLifetimeRound()) { permission.setExpires( InstantHelper.truncate(permission.getExpires(), permissionMapping.getLifetimeUnit()));