hotfix permissions

This commit is contained in:
_Bastler 2024-01-02 16:41:13 +01:00
parent ebe0d67780
commit bcb235d9ea

View File

@ -420,8 +420,7 @@ public class PermissionManager implements UserDataProvider {
List<Permission> existingPermissions = get(target, name);
for (Permission existingPermission : existingPermissions) {
if (additional && existingPermission.getExpires().isAfter(Instant.now())
&& (starts == null && (existingPermission.getStarts() == null
if (additional && (starts == null && (existingPermission.getStarts() == null
|| existingPermission.getStarts().isBefore(Instant.now()))
|| starts != null && (starts.isBefore(existingPermission.getExpires())
|| existingPermission.getStarts() != null
@ -441,8 +440,6 @@ public class PermissionManager implements UserDataProvider {
permission.setAddon(permissionMapping.isAddon());
permission.setStarts(permissionStarts);
permission.setExpires(permissionsExpires);
logger.debug("now: " + Instant.now() + "\nstart: " + permissionStarts + "\nexpires here: "
+ permission.getExpires());
} else {
if (permission.getExpires() == null || permission.getExpires().isBefore(Instant.now())) {
permission.setExpires(Instant.now());
@ -460,10 +457,6 @@ public class PermissionManager implements UserDataProvider {
permission.setExpires(
InstantHelper.truncate(permission.getExpires(), permissionMapping.getLifetimeUnit()));
}
logger.debug("Permission: \n" + permission.getName() + "\n" + permission.getId() + "\n"
+ permission.getTarget() + "\n" + permission.getStarts() + "\n" + permission.getExpires());
permissions.add(permission);
}
}