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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
package org.anjocaido.groupmanager.permissions;
//import java.util.Collection;
//import java.util.Map;
//import java.util.Set;
import java.util.List;
import org.anjocaido.groupmanager.data.Group;
//import org.anjocaido.groupmanager.data.User;
import org.bukkit.entity.Player;
/**
* Made by Nijikokun. Changed by Gabriel Couto
*
* This class is intended to *read* permissions from a single world.
*
* @author Nijikokun
* @author Gabriel Couto
* @author ElgarL
*/
public abstract class PermissionsReaderInterface {
/**
*
* @param player
* @param string
* @return true if has permission
*/
public abstract boolean has(Player player, String string);
/**
*
* @param player
* @param string
* @return true if has permission
*/
public abstract boolean permission(Player player, String string);
/**
*
* @param userName
* @return group name for this player.
*/
public abstract String getGroup(String userName);
/**
*
* @param userName
* @param groupName
* @return true if in group
*/
public abstract boolean inGroup(String userName, String groupName);
/**
*
* @param groupName
* @return String of prefix
*/
public abstract String getGroupPrefix(String groupName);
/**
*
* @param groupName
* @return String of suffix
*/
public abstract String getGroupSuffix(String groupName);
/**
*
* @param groupName
* @return true if can build
*/
public abstract boolean canGroupBuild(String groupName);
/**
*
* @param groupName
* @param node
* @return String value
*/
public abstract String getGroupPermissionString(String groupName, String node);
/**
*
* @param groupName
* @param node
* @return integer value
*/
public abstract int getGroupPermissionInteger(String groupName, String node);
/**
*
* @param groupName
* @param node
* @return boolean value
*/
public abstract boolean getGroupPermissionBoolean(String groupName, String node);
/**
*
* @param groupName
* @param node
* @return double value
*/
public abstract double getGroupPermissionDouble(String groupName, String node);
/**
*
* @param userName
* @param node
* @return String value
*/
public abstract String getUserPermissionString(String userName, String node);
/**
*
* @param userName
* @param node
* @return integer value
*/
public abstract int getUserPermissionInteger(String userName, String node);
/**
*
* @param userName
* @param node
* @return boolean value
*/
public abstract boolean getUserPermissionBoolean(String userName, String node);
/**
*
* @param userName
* @param node
* @return double value
*/
public abstract double getUserPermissionDouble(String userName, String node);
/**
*
* @param userName
* @param node
* @return String value
*/
public abstract String getPermissionString(String userName, String node);
/**
*
* @param userName
* @param node
* @return integer value
*/
public abstract int getPermissionInteger(String userName, String node);
/**
*
* @param userName
* @param node
* @return boolean value
*/
public abstract boolean getPermissionBoolean(String userName, String node);
/**
*
* @param userName
* @param node
* @return double value
*/
public abstract double getPermissionDouble(String userName, String node);
/////////////////////////////
/**
* Gets the appropriate prefix for the user.
* This method is a utility method for chat plugins to get the user's prefix
* without having to look at every one of the user's ancestors.
* Returns an empty string if user has no parent groups.
*
* @param user Player's name
* @return Player's prefix
*/
public abstract String getUserPrefix(String user);
/**
* Gets the appropriate suffix for the user.
* This method is a utility method for chat plugins to get the user's suffix
* without having to look at every one of the user's ancestors.
* Returns an empty string if user has no parent groups.
*
* @param user Player's name
* @return Player's suffix
*/
public abstract String getUserSuffix(String user);
/**
* Returns the group object representing the default group of the given world.
* This method will return null if the object does not exist or the world has no default group.
* @return Group object representing default world, or null if it doesn't exist or is not defined.
*/
public abstract Group getDefaultGroup();
/**
* Gets a array of the names of all parent groups in the same world.
* @param name Target user's name
* @return An array containing the names of all parent groups (including ancestors) that are in the same world
*/
public abstract String[] getGroups(String name);
public abstract String getInfoString(String entryName, String path, boolean isGroup);
//public abstract String getInfoString(String entryName, String path, boolean isGroup, Comparator<String> comparator);
public abstract int getInfoInteger(String entryName, String path, boolean isGroup);
//public abstract int getInfoInteger(String entryName, String path, boolean isGroup, Comparator<Integer> comparator);
/**
* Gets a double from the Info node without inheritance.
* @param entryName
* @param path
* @param isGroup
* @return -1 if not found
*/
public abstract double getInfoDouble(String entryName, String path, boolean isGroup);
//public abstract double getInfoDouble(String entryName, String path, boolean isGroup, Comparator<Double> comparator);
public abstract boolean getInfoBoolean(String entryName, String path, boolean isGroup);
//public abstract boolean getInfoBoolean(String entryName, String path, boolean isGroup, Comparator<Boolean> comparator);
public abstract void addUserInfo(String name, String path, Object data);
public abstract void removeUserInfo(String name, String path);
public abstract void addGroupInfo(String name, String path, Object data);
public abstract void removeGroupInfo(String name, String path);
//////////////////////////////
public abstract List<String> getAllPlayersPermissions(String userName);
}
|