mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Permission for merging with friends
This commit is contained in:
parent
ab1a89e601
commit
f2b0fa43dc
@ -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() {
|
||||
|
@ -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;
|
||||
@ -27,6 +29,10 @@ public enum Permissions {
|
||||
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)) {
|
||||
return true;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user