diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java index ea89f5ca3..e8d8d2feb 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Merge.java @@ -159,6 +159,10 @@ public class Merge extends SubCommand { multiUUID.add(u2); } if (multiMerge) { + if (!Permissions.hasPermission(plr, Permissions.MERGE_OTHER)) { + MainUtil.sendMessage(plr, C.NO_PERMISSION, Permissions.MERGE_OTHER); + return false; + } for (final UUID uuid : multiUUID) { PlotPlayer accepter = UUIDHandler.getPlayer(uuid); CmdConfirm.addPending(accepter, C.MERGE_REQUEST_CONFIRM.s().replaceAll("%s", plr.getName()), new Runnable() { diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/Permissions.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/Permissions.java index 26c7c9f88..9eac3173b 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/Permissions.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/Permissions.java @@ -17,7 +17,9 @@ public enum Permissions { // BREAK BREAK_OTHER("plots.admin.break.other", "break"), BREAK_ROAD("plots.admin.break.road", "break"), - BREAK_UNOWNED("plots.admin.break.unowned", "break"); + BREAK_UNOWNED("plots.admin.break.unowned", "break"), + // MERGE + MERGE_OTHER("plots.merge.other", "merge"); public String s; public String cat; @@ -26,6 +28,10 @@ public enum Permissions { this.s = perm; this.cat = cat; } + + public static boolean hasPermission(final PlotPlayer player, final Permissions perm) { + return hasPermission(player, perm.s); + } public static boolean hasPermission(final PlotPlayer player, final String perm) { if ((player == null) || player.isOp() || player.hasPermission(ADMIN.s)) { diff --git a/PlotSquared/src/main/resources/plugin.yml b/PlotSquared/src/main/resources/plugin.yml index 8b5f9d3a3..37969fb2b 100644 --- a/PlotSquared/src/main/resources/plugin.yml +++ b/PlotSquared/src/main/resources/plugin.yml @@ -112,6 +112,7 @@ permissions: plots.set.biome: true plots.set.home: true plots.merge: true + plots.merge.other: true plots.unlink: true plots.denied: true plots.add: true