Skip to content

Commit

Permalink
fix!: change admin core permissions to at.admin.core.command
Browse files Browse the repository at this point in the history
  • Loading branch information
Thatsmusic99 committed Jun 6, 2023
1 parent 6bda7cf commit 334d8b4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
32 changes: 23 additions & 9 deletions AdvancedTeleport-Bukkit/build.gradle.kts
Expand Up @@ -443,19 +443,33 @@ bukkit {
)
}

register("at.admin.core.*"){
default = BukkitPluginDescription.Permission.Default.OP
childrenMap = mapOf(
"at.admin.core.clearcache" to true,
"at.admin.core.export" to true,
"at.admin.core.import" to true,
"at.admin.core.map" to true,
"at.admin.core.particles" to true,
"at.admin.core.purge" to true,
"at.admin.core.reload" to true,
"at.admin.core.map.*" to true
)
}

register("at.member.core.*") {
default = BukkitPluginDescription.Permission.Default.OP
childrenMap = mapOf(
"at.member.core.clearcache" to true,
"at.member.core.export" to true,
"at.member.core.clearcache" to false,
"at.member.core.export" to false,
"at.member.core.help" to true,
"at.member.core.import" to true,
"at.member.core.import" to false,
"at.member.core.info" to true,
"at.member.core.map" to true,
"at.member.core.particles" to true,
"at.member.core.purge" to true,
"at.member.core.reload" to true,
"at.member.core.map.*" to true
"at.member.core.map" to false,
"at.member.core.particles" to false,
"at.member.core.purge" to false,
"at.member.core.reload" to false,
"at.member.core.map.*" to false
)
}

Expand Down Expand Up @@ -506,7 +520,7 @@ bukkit {
"at.member.warps.location" to true,
"at.member.homes.location" to true,
"at.member.spawn.*" to false,
"at.member.core.*" to false
"at.member.core.*" to true
)
}

Expand Down
Expand Up @@ -37,7 +37,7 @@ public boolean onCommand(
help.onCommand(sender, cmd, s, args);
return true;
}
if (sender.hasPermission("at.member.core." + command)) {
if (sender.hasPermission("at.member.core." + command) || sender.hasPermission("at.admin.core." + command)) {
CommandManager.subcommands.get(command).onCommand(sender, cmd, s, Arrays.copyOfRange(args, 1, args.length));
} else {
CustomMessages.sendMessage(sender, "Error.noPermission");
Expand Down Expand Up @@ -73,7 +73,7 @@ public boolean getRequiredFeature() {
List<String> availableCommands = new ArrayList<>();
List<String> chosenCommands = new ArrayList<>();
for (String command : CommandManager.subcommands.keySet()) {
if (sender.hasPermission("at.member.core." + command)) {
if (sender.hasPermission("at.member.core." + command) || sender.hasPermission("at.admin.core." + command)) {
availableCommands.add(command);
}
}
Expand Down
Expand Up @@ -870,7 +870,7 @@ public void postSave() {
permObject.setDefault(PermissionDefault.TRUE);
defaults.add(permission);
}
}, 200);
}, 20);
}

public static class ConfigOption<T> {
Expand Down

0 comments on commit 334d8b4

Please sign in to comment.