Factions/src/com/massivecraft/factions/struct/Permission.java
Brettflan bc40f3b751 Server admins can now promote or demote any member of any faction to/from faction leader or officer using the existing /f leader and /f officer commands, with two new permissions added to allow that. A third permission is also added to allow server admins or moderators to join any faction without the need of /f bypass mode.
Also, a couple more minor bugfixes are included for /f home payment giving the wrong message, player/faction descriptions being wrong for console messages, and potential NPE in new faction leader promotion routine if faction was permanent with no current leader.

New permissions:
factions.leader.any - allows use of /f leader on any player in any faction
factions officer.any - allows use of /f officer on any player in any faction
factions.join.any - allows player to join any faction, bypassing invitation process for closed factions (the same as players with /f bypass enabled can do)
2012-01-18 06:01:50 -06:00

74 lines
1.5 KiB
Java

package com.massivecraft.factions.struct;
import org.bukkit.command.CommandSender;
import com.massivecraft.factions.P;
public enum Permission
{
ADMIN("adminmode"),
AUTOCLAIM("autoclaim"),
CHAT("chat"),
CHATSPY("chatspy"),
CLAIM("claim"),
CONFIG("config"),
CREATE("create"),
DEINVITE("deinvite"),
DESCRIPTION("description"),
DISBAND("disband"),
FLAG("flag"),
FLAG_SET("flag.set"),
HELP("help"),
HOME("home"),
INVITE("invite"),
JOIN("join"),
JOIN_ANY("join.any"),
KICK("kick"),
LEADER("leader"),
LEADER_ANY("leader.any"),
LEAVE("leave"),
LIST("list"),
LOCK("lock"),
MAP("map"),
MONEY_BALANCE("money.balance"),
MONEY_BALANCE_ANY("money.balance.any"),
MONEY_DEPOSIT("money.deposit"),
MONEY_F2F("money.f2f"),
MONEY_F2P("money.f2p"),
MONEY_P2F("money.p2f"),
MONEY_WITHDRAW("money.withdraw"),
OFFICER("officer"),
OFFICER_ANY("officer.any"),
OPEN("open"),
PERM("perm"),
POWER("power"),
POWER_ANY("power.any"),
RELATION("relation"),
RELOAD("reload"),
SAVE("save"),
SETHOME("sethome"),
SHOW("show"),
TAG("tag"),
TITLE("title"),
UNCLAIM("unclaim"),
UNCLAIM_ALL("unclaimall"),
VERSION("version"),
;
public final String node;
Permission(final String node)
{
this.node = "factions."+node;
}
public boolean has(CommandSender sender, boolean informSenderIfNot)
{
return P.p.perm.has(sender, this.node, informSenderIfNot);
}
public boolean has(CommandSender sender)
{
return has(sender, false);
}
}