Skip to content

Commit

Permalink
Fix permission removal logic in VaultPermissionServiceWrapper
Browse files Browse the repository at this point in the history
Previously, the groupRemove method incorrectly deleted the entire group instead of simply removing the specified permission. This update corrects the logic by properly retrieving the group and removing the permission, ensuring the integrity of group configurations.
  • Loading branch information
NonSwag committed Dec 3, 2024
1 parent 412e7d5 commit f8a9784
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public boolean groupRemove(String world, String groupName, String permission) {
var groupController = groupController();
return Optional.ofNullable(world)
.map(plugin.getServer()::getWorld)
.map(target -> groupController.deleteGroup(group, target))
.orElseGet(() -> groupController.deleteGroup(group))
.join();
.flatMap(target -> groupController.getGroup(groupName, target))
.map(group -> group.removePermission(permission))
.orElse(false);
}

@Override
Expand Down

0 comments on commit f8a9784

Please sign in to comment.