1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
package com.earth2me.essentials.perm;
import com.earth2me.essentials.Util;
import com.earth2me.essentials.api.IPermission;
import java.util.Locale;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permission;
import org.bukkit.permissions.PermissionDefault;
public enum Permissions implements IPermission
{
AFK,
AFK_KICKEXEMPT,
AFK_OTHERS,
BACK_ONDEATH,
BALANCE_OTHERS,
BAN_EXEMPT,
BAN_NOTIFY,
BAN_OFFLINE,
BREAK_BEDROCK,
CHAT_COLOR,
CHAT_SPY,
CLEARINVENTORY_OTHERS,
DELHOME_OTHERS,
ECO_LOAN(PermissionDefault.FALSE),
FEED_OTHERS,
GAMEMODE_OTHERS,
GEOIP_HIDE(PermissionDefault.FALSE),
GEOIP_SHOW(PermissionDefault.TRUE),
GETPOS_OTHERS,
GOD_OTHERS,
HEAL_COOLDOWN_BYPASS,
HEAL_OTHERS,
HELPOP_RECEIVE,
HOME_OTHERS,
JAIL_EXEMPT,
JOINFULLSERVER,
KICK_EXEMPT,
KICK_NOTIFY,
LIST_HIDDEN,
MAIL,
MAIL_SEND,
MAIL_SENDALL,
MOTD,
MSG_COLOR,
MUTE_EXEMPT,
NEAR_OTHERS,
NICK_COLOR,
NICK_OTHERS,
NOGOD_OVERRIDE,
OVERSIZEDSTACKS(PermissionDefault.FALSE),
POWERTOOL_APPEND,
PTIME_OTHERS,
REPAIR_ARMOR,
REPAIR_ENCHANTED,
SETHOME_MULTIPLE,
SETHOME_OTHERS,
SLEEPINGIGNORED,
SPAWN_OTHERS,
SUDO_EXEMPT,
TELEPORT_COOLDOWN_BYPASS,
TELEPORT_HIDDEN,
TELEPORT_TIMER_BYPASS,
TEMPBAN_EXEMPT,
TEMPBAN_OFFLINE,
TIME_SET,
TOGGLEJAIL_OFFLINE,
TPA,
TPAALL,
TPAHERE,
TPOHERE,
UNLIMITED_OTHERS,
WARP_LIST(PermissionDefault.TRUE),
WARP_OTHERS;
private static final String base = "essentials.";
private final String permission;
private final PermissionDefault defaultPerm;
private transient Permission bukkitPerm = null;
private Permissions()
{
this(PermissionDefault.OP);
}
private Permissions(final PermissionDefault defaultPerm)
{
permission = base + toString().toLowerCase(Locale.ENGLISH).replace('_', '.');
this.defaultPerm = defaultPerm;
}
@Override
public String getPermission()
{
return permission;
}
@Override
public Permission getBukkitPermission()
{
if (bukkitPerm != null)
{
return bukkitPerm;
}
else
{
return Util.registerPermission(getPermission(), getPermissionDefault());
}
}
@Override
public PermissionDefault getPermissionDefault()
{
return this.defaultPerm;
}
@Override
public boolean isAuthorized(CommandSender sender)
{
return sender.hasPermission(getBukkitPermission());
}
}
|