Skip to content

Commit

Permalink
Fixes a bug in permission check which fails if owner was not online.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Aug 17, 2021
1 parent 8e3c781 commit fc29741
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -985,8 +985,8 @@ public void checkGeneratorUnlockStatus(Island island, @Nullable User user, @Null
// Filter out generators with larger minimal island level then current island level.
filter(generator -> generator.getRequiredMinIslandLevel() <= islandLevel).
// Filter out generators with missing permissions
filter(generator -> owner != null && owner.isPlayer() &&
Utils.matchAllPermissions(owner, generator.getRequiredPermissions())).
filter(generator -> generator.getRequiredPermissions().isEmpty() ||
owner != null && owner.isOnline() && Utils.matchAllPermissions(owner, generator.getRequiredPermissions())).
// Now process each generator.
forEach(generator -> this.unlockGenerator(dataObject, user, island, generator));
}
Expand Down

0 comments on commit fc29741

Please sign in to comment.