Factions/src/com/massivecraft/factions/struct/Permission.java
Brettflan d71bd15a79 Added possibility to specify a player in the /f join command (/f join <faction> [player=you]), to make a player other than yourself join the specified faction. The new permission factions.join.others (added to factions.kit.mod and above) is required to be able to specify a different player.
Note that the player cannot currently already be in another faction; if they are, you'll need to /f kick them first. Also note that if the faction isn't open (with no invitation required), the player isn't invited, and you don't have the factions.join.any permission or have admin bypass mode on, the attempt will also fail.

Also, added new log method which accepts arguments (like the msg method).
2012-02-26 12:29:44 -06:00

77 lines
1.6 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"),
JOIN_OTHERS("join.others"),
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"),
POWERBOOST("powerboost"),
RELATION("relation"),
RELOAD("reload"),
SAVE("save"),
SEE_CHUNK("seechunk"),
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);
}
}