Fix flag definition GUI not checking definition permission group.

This commit is contained in:
bloodshot 2020-08-30 16:35:29 -04:00
parent d2f5fb3ffd
commit b5b61b8b7a
4 changed files with 8 additions and 8 deletions

View File

@ -133,7 +133,7 @@ public FlagDefinition deserialize(TypeToken<?> type, ConfigurationNode node) thr
} }
Set<Context> contexts = new HashSet<>(); Set<Context> contexts = new HashSet<>();
GDPermissionHolder subject = GriefDefenderPlugin.DEFAULT_HOLDER; GDPermissionHolder subject = GriefDefenderPlugin.GD_DEFINITION_HOLDER;
if (contextList != null) { if (contextList != null) {
for (String context : contextList) { for (String context : contextList) {
final String parts[] = context.split("="); final String parts[] = context.split("=");
@ -168,7 +168,7 @@ public FlagDefinition deserialize(TypeToken<?> type, ConfigurationNode node) thr
if (PermissionUtil.getInstance().hasGroupSubject(value)) { if (PermissionUtil.getInstance().hasGroupSubject(value)) {
subject = PermissionHolderCache.getInstance().getOrCreateGroup(value); subject = PermissionHolderCache.getInstance().getOrCreateGroup(value);
if (subject == null) { if (subject == null) {
subject = GriefDefenderPlugin.DEFAULT_HOLDER; subject = GriefDefenderPlugin.GD_DEFINITION_HOLDER;
} }
} }
} }

View File

@ -149,7 +149,7 @@ public static class FlagDefinitionBuilder implements Builder {
private boolean isAdmin = false; private boolean isAdmin = false;
private Set<Context> contexts = new HashSet<>(); private Set<Context> contexts = new HashSet<>();
private List<FlagData> data = new ArrayList<>(); private List<FlagData> data = new ArrayList<>();
private Subject subject = GriefDefenderPlugin.DEFAULT_HOLDER; private Subject subject = GriefDefenderPlugin.GD_DEFINITION_HOLDER;
private String displayName; private String displayName;
private String groupName; private String groupName;
private Tristate defaultValue = Tristate.UNDEFINED; private Tristate defaultValue = Tristate.UNDEFINED;
@ -231,7 +231,7 @@ public Builder reset() {
this.groupName = ""; this.groupName = "";
this.defaultValue = Tristate.UNDEFINED; this.defaultValue = Tristate.UNDEFINED;
this.description = TextComponent.empty(); this.description = TextComponent.empty();
this.subject = GriefDefenderPlugin.DEFAULT_HOLDER; this.subject = GriefDefenderPlugin.GD_DEFINITION_HOLDER;
return this; return this;
} }

View File

@ -133,7 +133,7 @@ public FlagDefinition deserialize(TypeToken<?> type, ConfigurationNode node) thr
} }
Set<Context> contexts = new HashSet<>(); Set<Context> contexts = new HashSet<>();
GDPermissionHolder subject = GriefDefenderPlugin.DEFAULT_HOLDER; GDPermissionHolder subject = GriefDefenderPlugin.GD_DEFINITION_HOLDER;
if (contextList != null) { if (contextList != null) {
for (String context : contextList) { for (String context : contextList) {
final String parts[] = context.split("="); final String parts[] = context.split("=");
@ -168,7 +168,7 @@ public FlagDefinition deserialize(TypeToken<?> type, ConfigurationNode node) thr
if (PermissionUtil.getInstance().hasGroupSubject(value)) { if (PermissionUtil.getInstance().hasGroupSubject(value)) {
subject = PermissionHolderCache.getInstance().getOrCreateGroup(value); subject = PermissionHolderCache.getInstance().getOrCreateGroup(value);
if (subject == null) { if (subject == null) {
subject = GriefDefenderPlugin.DEFAULT_HOLDER; subject = GriefDefenderPlugin.GD_DEFINITION_HOLDER;
} }
} }
} }

View File

@ -149,7 +149,7 @@ public static class FlagDefinitionBuilder implements Builder {
private boolean isAdmin = false; private boolean isAdmin = false;
private Set<Context> contexts = new HashSet<>(); private Set<Context> contexts = new HashSet<>();
private List<FlagData> data = new ArrayList<>(); private List<FlagData> data = new ArrayList<>();
private Subject subject = GriefDefenderPlugin.DEFAULT_HOLDER; private Subject subject = GriefDefenderPlugin.GD_DEFINITION_HOLDER;
private String displayName; private String displayName;
private String groupName; private String groupName;
private Tristate defaultValue = Tristate.UNDEFINED; private Tristate defaultValue = Tristate.UNDEFINED;
@ -231,7 +231,7 @@ public Builder reset() {
this.groupName = ""; this.groupName = "";
this.defaultValue = Tristate.UNDEFINED; this.defaultValue = Tristate.UNDEFINED;
this.description = TextComponent.empty(); this.description = TextComponent.empty();
this.subject = GriefDefenderPlugin.DEFAULT_HOLDER; this.subject = GriefDefenderPlugin.GD_DEFINITION_HOLDER;
return this; return this;
} }