Subscribe to default permissions too

This commit is contained in:
Luck 2017-01-14 23:49:45 +00:00
parent 6501e5cf8d
commit f1a1612f5d
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 9 additions and 1 deletions

View File

@ -84,6 +84,7 @@ public class DefaultsProvider {
@Getter @Getter
private Map<String, Boolean> opDefaults = ImmutableMap.of(); private Map<String, Boolean> opDefaults = ImmutableMap.of();
private final DummyPermissible opDummy = new DummyPermissible(this::refreshOp); private final DummyPermissible opDummy = new DummyPermissible(this::refreshOp);
@Getter @Getter
private Map<String, Boolean> nonOpDefaults = ImmutableMap.of(); private Map<String, Boolean> nonOpDefaults = ImmutableMap.of();
private final DummyPermissible nonOpDummy = new DummyPermissible(this::refreshNonOp); private final DummyPermissible nonOpDummy = new DummyPermissible(this::refreshNonOp);

View File

@ -92,7 +92,14 @@ public class LPPermissible extends PermissibleBase {
} }
public void updateSubscriptions() { public void updateSubscriptions() {
Set<String> ent = user.getUserData().getPermissionData(calculateContexts()).getImmutableBacking().keySet(); Set<String> ent = new HashSet<>(user.getUserData().getPermissionData(calculateContexts()).getImmutableBacking().keySet());
if (parent.isOp()) {
ent.addAll(plugin.getDefaultsProvider().getOpDefaults().keySet());
} else {
ent.addAll(plugin.getDefaultsProvider().getNonOpDefaults().keySet());
}
subscriptions.subscribe(ent); subscriptions.subscribe(ent);
} }