try to hotfix permission expiring

This commit is contained in:
_Bastler 2023-12-18 09:46:36 +01:00
parent 6d7407979d
commit ba28c98e44

View File

@ -416,7 +416,11 @@ public class PermissionManager implements UserDataProvider {
List<Permission> 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)) {