Factions/src/com/massivecraft/factions/struct/Permission.java

75 lines
1.5 KiB
Java
Raw Normal View History

2011-10-08 18:44:47 +02:00
package com.massivecraft.factions.struct;
import org.bukkit.command.CommandSender;
2011-10-08 23:22:02 +02:00
import com.massivecraft.factions.P;
2011-10-08 18:44:47 +02:00
public enum Permission
{
ADMIN("adminmode"),
2011-10-09 21:57:43 +02:00
AUTOCLAIM("autoclaim"),
CHAT("chat"),
2011-11-27 20:32:41 +01:00
CHATSPY("chatspy"),
2011-10-09 21:57:43 +02:00
CLAIM("claim"),
CONFIG("config"),
CREATE("create"),
DEINVITE("deinvite"),
DESCRIPTION("description"),
DISBAND("disband"),
2011-10-23 20:50:49 +02:00
FLAG("flag"),
FLAG_SET("flag.set"),
2011-10-09 21:57:43 +02:00
HELP("help"),
HOME("home"),
INVITE("invite"),
JOIN("join"),
JOIN_ANY("join.any"),
2011-10-09 21:57:43 +02:00
KICK("kick"),
LEADER("leader"),
LEADER_ANY("leader.any"),
2011-10-09 21:57:43 +02:00
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"),
2011-10-09 21:57:43 +02:00
OPEN("open"),
PERM("perm"),
2011-10-09 21:57:43 +02:00
POWER("power"),
POWER_ANY("power.any"),
POWERBOOST("powerboost"),
2011-10-09 21:57:43 +02:00
RELATION("relation"),
RELOAD("reload"),
SAVE("save"),
SETHOME("sethome"),
SHOW("show"),
TAG("tag"),
TITLE("title"),
UNCLAIM("unclaim"),
UNCLAIM_ALL("unclaimall"),
VERSION("version"),
2011-10-08 18:44:47 +02:00
;
public final String node;
Permission(final String node)
{
this.node = "factions."+node;
2011-10-08 18:44:47 +02:00
}
2011-10-08 23:22:02 +02:00
public boolean has(CommandSender sender, boolean informSenderIfNot)
{
return P.p.perm.has(sender, this.node, informSenderIfNot);
}
2011-10-08 18:44:47 +02:00
public boolean has(CommandSender sender)
2011-10-08 23:22:02 +02:00
{
return has(sender, false);
}
2011-10-08 18:44:47 +02:00
}