From ba28c98e44be5a454c97b75a85b68d76480ba2ed Mon Sep 17 00:00:00 2001 From: _Bastler Date: Mon, 18 Dec 2023 09:46:36 +0100 Subject: [PATCH] try to hotfix permission expiring --- .../java/de/bstly/we/businesslogic/PermissionManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 bc8ec51..cd8fc92 100755 --- a/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java +++ b/core/src/main/java/de/bstly/we/businesslogic/PermissionManager.java @@ -416,7 +416,11 @@ public class PermissionManager implements UserDataProvider { List existingPermissions = get(target, name); for (Permission existingPermission : existingPermissions) { - if (existingPermission.getExpires().isBefore(permissionsExpires)) { + if (existingPermission.getExpires().isBefore(permissionsExpires) + || permissionMapping.isLifetimeRound() && InstantHelper + .truncate(existingPermission.getExpires(), permissionMapping.getLifetimeUnit()) + .isBefore(InstantHelper.truncate(permissionsExpires, + permissionMapping.getLifetimeUnit()))) { if (starts != null) { if (existingPermission.getStarts() == null || existingPermission.getStarts().isAfter(starts) || existingPermission.getExpires().isAfter(starts)) {