hotfix permissions
This commit is contained in:
parent
ebe0d67780
commit
bcb235d9ea
@ -420,12 +420,11 @@ 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
|
||||
|| existingPermission.getStarts().isBefore(Instant.now()))
|
||||
|| starts != null && (starts.isBefore(existingPermission.getExpires())
|
||||
|| existingPermission.getStarts() != null
|
||||
&& starts.isAfter(existingPermission.getStarts())))) {
|
||||
if (additional && (starts == null && (existingPermission.getStarts() == null
|
||||
|| existingPermission.getStarts().isBefore(Instant.now()))
|
||||
|| starts != null && (starts.isBefore(existingPermission.getExpires())
|
||||
|| existingPermission.getStarts() != null
|
||||
&& starts.isAfter(existingPermission.getStarts())))) {
|
||||
if (permission == null) {
|
||||
permission = existingPermission;
|
||||
} else if (existingPermission.getExpires().isAfter(permission.getExpires())) {
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user