Permalink
Browse files

Use GROUP_PREFIX

  • Loading branch information...
PseudoKnight committed Aug 3, 2018
1 parent f62e7ca commit 935ba10be43565ec7d3db8e8b7339e913838012c
@@ -95,13 +95,13 @@ public boolean isPermissionSet(String perm) {
public List<String> getGroups() {
// As in https://github.com/sk89q/WorldEdit/blob/master/
// worldedit-bukkit/src/main/java/com/sk89q/wepif/DinnerPermsResolver.java#L112-L126
List<String> groupNames = new ArrayList<String>();
List<String> groupNames = new ArrayList<>();
for(PermissionAttachmentInfo permAttach : c.getEffectivePermissions()) {
String perm = permAttach.getPermission();
if(!(perm.startsWith(Static.groupPrefix) && permAttach.getValue())) {
if(!(perm.startsWith(Static.GROUP_PREFIX) && permAttach.getValue())) {
continue;
}
groupNames.add(perm.substring(Static.groupPrefix.length(), perm.length()));
groupNames.add(perm.substring(Static.GROUP_PREFIX.length(), perm.length()));
}
return groupNames;
}
@@ -250,17 +250,17 @@ public boolean isPermissionSet(String perm) {
List<String> groupNames = new ArrayList<String>();
for(PermissionAttachmentInfo permAttach : p.getEffectivePermissions()) {
String perm = permAttach.getPermission();
if(!(perm.startsWith(Static.groupPrefix) && permAttach.getValue())) {
if(!(perm.startsWith(Static.GROUP_PREFIX) && permAttach.getValue())) {
continue;
}
groupNames.add(perm.substring(Static.groupPrefix.length(), perm.length()));
groupNames.add(perm.substring(Static.GROUP_PREFIX.length(), perm.length()));
}
return groupNames;
}
@Override
public boolean inGroup(String groupName) {
return p.hasPermission(Static.groupPrefix + groupName);
return p.hasPermission(Static.GROUP_PREFIX + groupName);
}
@Override
@@ -112,12 +112,6 @@ private Static() {
* Third party APIs may provide better access.
*/
public static final String GROUP_PREFIX = "group.";
/**
* @deprecated Use {@link #GROUP_PREFIX} instead.
*/
@Deprecated // Deprecated on 14-06-2018 dd-mm-yyyy.
@SuppressWarnings("checkstyle:constantname") // Fixing this violation might break dependents.
public static final String groupPrefix = GROUP_PREFIX;
/**
* The label representing unrestricted access.

0 comments on commit 935ba10

Please sign in to comment.