try to hotfix permission expiring
This commit is contained in:
@@ -416,20 +416,16 @@ public class PermissionManager implements UserDataProvider {
|
|||||||
List<Permission> existingPermissions = get(target, name);
|
List<Permission> existingPermissions = get(target, name);
|
||||||
|
|
||||||
for (Permission existingPermission : existingPermissions) {
|
for (Permission existingPermission : existingPermissions) {
|
||||||
if (existingPermission.getExpires().isBefore(permissionsExpires)
|
if (additional && existingPermission.getExpires().isAfter(Instant.now())
|
||||||
|| permissionMapping.isLifetimeRound() && InstantHelper
|
&& (starts == null && (existingPermission.getStarts() == null
|
||||||
.truncate(existingPermission.getExpires(), permissionMapping.getLifetimeUnit())
|
|| existingPermission.getStarts().isBefore(Instant.now()))
|
||||||
.isBefore(InstantHelper.truncate(permissionsExpires,
|
|| starts != null && (starts.isBefore(existingPermission.getExpires())
|
||||||
permissionMapping.getLifetimeUnit()))) {
|
|| existingPermission.getStarts() != null
|
||||||
if (starts != null) {
|
&& starts.isAfter(existingPermission.getStarts())))) {
|
||||||
if (existingPermission.getStarts() == null || existingPermission.getStarts().isAfter(starts)
|
if (permission == null) {
|
||||||
|| existingPermission.getExpires().isAfter(starts)) {
|
|
||||||
permission = existingPermission;
|
permission = existingPermission;
|
||||||
break;
|
} else if (existingPermission.getExpires().isAfter(permission.getExpires())) {
|
||||||
}
|
|
||||||
} else if (existingPermission.getStarts() == null) {
|
|
||||||
permission = existingPermission;
|
permission = existingPermission;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user