hotfix permissions

This commit is contained in:
_Bastler 2024-01-02 16:25:16 +01:00
parent 4bb32dc407
commit b282131c4d

View File

@ -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()));