Register Sponge PermDescriptions to the LP permission registry
This commit is contained in:
parent
7684ac5d3a
commit
f33c540efb
@ -72,7 +72,7 @@ public class MonitoredPermissibleBase extends PermissibleBase {
|
||||
|
||||
private void logCheck(CheckOrigin origin, String permission, boolean result) {
|
||||
this.plugin.getVerboseHandler().offerCheckData(origin, this.name, ContextSet.empty(), permission, Tristate.fromBoolean(result));
|
||||
this.plugin.getPermissionVault().offer(permission);
|
||||
this.plugin.getPermissionRegistry().offer(permission);
|
||||
}
|
||||
|
||||
PermissibleBase getDelegate() {
|
||||
|
@ -32,7 +32,7 @@ import com.google.common.collect.ForwardingMap;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||
import me.lucko.luckperms.common.treeview.PermissionVault;
|
||||
import me.lucko.luckperms.common.treeview.PermissionRegistry;
|
||||
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@ -52,7 +52,7 @@ import javax.annotation.Nullable;
|
||||
*
|
||||
* This instance allows LuckPerms to intercept calls to
|
||||
* {@link PluginManager#addPermission(Permission)} and record permissions in the
|
||||
* {@link PermissionVault}.
|
||||
* {@link PermissionRegistry}.
|
||||
*
|
||||
* It also allows us to pre-determine child permission relationships.
|
||||
*
|
||||
@ -99,7 +99,7 @@ public final class LPPermissionMap extends ForwardingMap<String, Permission> {
|
||||
Objects.requireNonNull(key, "key");
|
||||
Objects.requireNonNull(value, "value");
|
||||
|
||||
this.plugin.getPermissionVault().offer(key);
|
||||
this.plugin.getPermissionRegistry().offer(key);
|
||||
Permission ret = super.put(key, value);
|
||||
update();
|
||||
return ret;
|
||||
@ -107,7 +107,7 @@ public final class LPPermissionMap extends ForwardingMap<String, Permission> {
|
||||
|
||||
@Override
|
||||
public void putAll(@Nonnull Map<? extends String, ? extends Permission> m) {
|
||||
this.plugin.getPermissionVault().offerAll(m.keySet());
|
||||
this.plugin.getPermissionRegistry().offerAll(m.keySet());
|
||||
super.putAll(m);
|
||||
update();
|
||||
}
|
||||
@ -117,7 +117,7 @@ public final class LPPermissionMap extends ForwardingMap<String, Permission> {
|
||||
Objects.requireNonNull(key, "key");
|
||||
Objects.requireNonNull(value, "value");
|
||||
|
||||
this.plugin.getPermissionVault().offer(key);
|
||||
this.plugin.getPermissionRegistry().offer(key);
|
||||
Permission ret = super.putIfAbsent(key, value);
|
||||
update();
|
||||
return ret;
|
||||
|
@ -115,7 +115,7 @@ public class BungeePermissionCheckListener implements Listener {
|
||||
String name = "internal/" + e.getSender().getName();
|
||||
|
||||
this.plugin.getVerboseHandler().offerCheckData(CheckOrigin.PLATFORM_PERMISSION_CHECK, name, ContextSet.empty(), permission, result);
|
||||
this.plugin.getPermissionVault().offer(permission);
|
||||
this.plugin.getPermissionRegistry().offer(permission);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
@ -132,6 +132,6 @@ public class BungeePermissionCheckListener implements Listener {
|
||||
String name = "internal/" + e.getSender().getName();
|
||||
|
||||
this.plugin.getVerboseHandler().offerCheckData(CheckOrigin.PLATFORM_LOOKUP_CHECK, name, ContextSet.empty(), permission, result);
|
||||
this.plugin.getPermissionVault().offer(permission);
|
||||
this.plugin.getPermissionRegistry().offer(permission);
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class PermissionCalculator implements CacheLoader<String, Tristate> {
|
||||
// offer the permission to the permission vault
|
||||
// we only need to do this once per permission, so it doesn't matter
|
||||
// that this call is behind the cache.
|
||||
this.plugin.getPermissionVault().offer(permission);
|
||||
this.plugin.getPermissionRegistry().offer(permission);
|
||||
|
||||
for (PermissionProcessor processor : this.processors) {
|
||||
Tristate result = processor.hasPermission(permission);
|
||||
|
@ -28,7 +28,7 @@ package me.lucko.luckperms.common.command.utils;
|
||||
import com.google.common.base.Splitter;
|
||||
|
||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||
import me.lucko.luckperms.common.treeview.PermissionVault;
|
||||
import me.lucko.luckperms.common.treeview.PermissionRegistry;
|
||||
import me.lucko.luckperms.common.treeview.TreeNode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -59,7 +59,7 @@ public final class TabCompletions {
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> getPermissionTabComplete(List<String> args, PermissionVault cache) {
|
||||
public static List<String> getPermissionTabComplete(List<String> args, PermissionRegistry cache) {
|
||||
if (args.size() <= 1) {
|
||||
if (args.isEmpty() || args.get(0).equals("")) {
|
||||
return cache.getRootNode().getChildren()
|
||||
|
@ -72,6 +72,6 @@ public class PermissionCheck extends SharedSubCommand {
|
||||
|
||||
@Override
|
||||
public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
|
||||
return getPermissionTabComplete(args, plugin.getPermissionVault());
|
||||
return getPermissionTabComplete(args, plugin.getPermissionRegistry());
|
||||
}
|
||||
}
|
||||
|
@ -77,6 +77,6 @@ public class PermissionCheckInherits extends SharedSubCommand {
|
||||
|
||||
@Override
|
||||
public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
|
||||
return getPermissionTabComplete(args, plugin.getPermissionVault());
|
||||
return getPermissionTabComplete(args, plugin.getPermissionRegistry());
|
||||
}
|
||||
}
|
||||
|
@ -99,6 +99,6 @@ public class PermissionSet extends SharedSubCommand {
|
||||
if (!ret.isEmpty()) {
|
||||
return ret;
|
||||
}
|
||||
return getPermissionTabComplete(args, plugin.getPermissionVault());
|
||||
return getPermissionTabComplete(args, plugin.getPermissionRegistry());
|
||||
}
|
||||
}
|
||||
|
@ -107,6 +107,6 @@ public class PermissionSetTemp extends SharedSubCommand {
|
||||
if (!ret.isEmpty()) {
|
||||
return ret;
|
||||
}
|
||||
return getPermissionTabComplete(args, plugin.getPermissionVault());
|
||||
return getPermissionTabComplete(args, plugin.getPermissionRegistry());
|
||||
}
|
||||
}
|
||||
|
@ -93,6 +93,6 @@ public class PermissionUnset extends SharedSubCommand {
|
||||
|
||||
@Override
|
||||
public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
|
||||
return getPermissionTabComplete(args, plugin.getPermissionVault());
|
||||
return getPermissionTabComplete(args, plugin.getPermissionRegistry());
|
||||
}
|
||||
}
|
||||
|
@ -93,6 +93,6 @@ public class PermissionUnsetTemp extends SharedSubCommand {
|
||||
|
||||
@Override
|
||||
public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
|
||||
return getPermissionTabComplete(args, plugin.getPermissionVault());
|
||||
return getPermissionTabComplete(args, plugin.getPermissionRegistry());
|
||||
}
|
||||
}
|
||||
|
@ -84,6 +84,6 @@ public class CheckCommand extends SingleCommand {
|
||||
}
|
||||
|
||||
args.remove(0);
|
||||
return TabCompletions.getPermissionTabComplete(args, plugin.getPermissionVault());
|
||||
return TabCompletions.getPermissionTabComplete(args, plugin.getPermissionRegistry());
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ public class SearchCommand extends SingleCommand {
|
||||
|
||||
@Override
|
||||
public List<String> tabComplete(LuckPermsPlugin plugin, Sender sender, List<String> args) {
|
||||
return TabCompletions.getPermissionTabComplete(args, plugin.getPermissionVault());
|
||||
return TabCompletions.getPermissionTabComplete(args, plugin.getPermissionRegistry());
|
||||
}
|
||||
|
||||
private static <T> void sendResult(Sender sender, List<HeldPermission<T>> results, Function<T, String> lookupFunction, Message headerMessage, HolderType holderType, String label, int page) {
|
||||
|
@ -83,7 +83,7 @@ public class TreeCommand extends SingleCommand {
|
||||
user = null;
|
||||
}
|
||||
|
||||
TreeView view = new TreeView(plugin.getPermissionVault(), selection);
|
||||
TreeView view = new TreeView(plugin.getPermissionRegistry(), selection);
|
||||
if (!view.hasData()) {
|
||||
Message.TREE_EMPTY.send(sender);
|
||||
return CommandResult.FAILURE;
|
||||
|
@ -56,7 +56,7 @@ import me.lucko.luckperms.common.storage.StorageFactory;
|
||||
import me.lucko.luckperms.common.storage.StorageType;
|
||||
import me.lucko.luckperms.common.storage.dao.file.FileWatcher;
|
||||
import me.lucko.luckperms.common.tasks.UpdateTask;
|
||||
import me.lucko.luckperms.common.treeview.PermissionVault;
|
||||
import me.lucko.luckperms.common.treeview.PermissionRegistry;
|
||||
import me.lucko.luckperms.common.verbose.VerboseHandler;
|
||||
|
||||
import java.io.File;
|
||||
@ -71,7 +71,7 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
|
||||
|
||||
// init during enable
|
||||
private VerboseHandler verboseHandler;
|
||||
private PermissionVault permissionVault;
|
||||
private PermissionRegistry permissionRegistry;
|
||||
private LogDispatcher logDispatcher;
|
||||
private LuckPermsConfiguration configuration;
|
||||
private LocaleManager localeManager;
|
||||
@ -104,7 +104,7 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
|
||||
|
||||
// load some utilities early
|
||||
this.verboseHandler = new VerboseHandler();
|
||||
this.permissionVault = new PermissionVault();
|
||||
this.permissionRegistry = new PermissionRegistry();
|
||||
this.logDispatcher = new LogDispatcher(this);
|
||||
|
||||
// load configuration
|
||||
@ -195,7 +195,7 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
|
||||
performEarlyDisableTasks();
|
||||
|
||||
// shutdown permission vault and verbose handler tasks
|
||||
this.permissionVault.stop();
|
||||
this.permissionRegistry.stop();
|
||||
this.verboseHandler.stop();
|
||||
|
||||
// remove any hooks into the platform
|
||||
@ -266,8 +266,8 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PermissionVault getPermissionVault() {
|
||||
return this.permissionVault;
|
||||
public PermissionRegistry getPermissionRegistry() {
|
||||
return this.permissionRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,7 +50,7 @@ import me.lucko.luckperms.common.plugin.bootstrap.LuckPermsBootstrap;
|
||||
import me.lucko.luckperms.common.sender.Sender;
|
||||
import me.lucko.luckperms.common.storage.Storage;
|
||||
import me.lucko.luckperms.common.storage.dao.file.FileWatcher;
|
||||
import me.lucko.luckperms.common.treeview.PermissionVault;
|
||||
import me.lucko.luckperms.common.treeview.PermissionRegistry;
|
||||
import me.lucko.luckperms.common.verbose.VerboseHandler;
|
||||
|
||||
import java.util.Collections;
|
||||
@ -208,11 +208,11 @@ public interface LuckPermsPlugin {
|
||||
VerboseHandler getVerboseHandler();
|
||||
|
||||
/**
|
||||
* Gets the permission caching instance for the platform.
|
||||
* Gets the permission registry for the platform.
|
||||
*
|
||||
* @return the permission cache instance
|
||||
* @return the permission registry
|
||||
*/
|
||||
PermissionVault getPermissionVault();
|
||||
PermissionRegistry getPermissionRegistry();
|
||||
|
||||
/**
|
||||
* Gets the log dispatcher running on the platform
|
||||
|
@ -43,7 +43,7 @@ import java.util.stream.Collectors;
|
||||
/**
|
||||
* Stores a collection of all permissions known to the platform.
|
||||
*/
|
||||
public class PermissionVault extends RepeatingTask {
|
||||
public class PermissionRegistry extends RepeatingTask {
|
||||
private static final Splitter DOT_SPLIT = Splitter.on('.').omitEmptyStrings();
|
||||
|
||||
// the root node in the tree
|
||||
@ -55,7 +55,7 @@ public class PermissionVault extends RepeatingTask {
|
||||
// a queue of permission strings to be processed by the tree
|
||||
private final Queue<String> queue;
|
||||
|
||||
public PermissionVault() {
|
||||
public PermissionRegistry() {
|
||||
super(1000, TimeUnit.MILLISECONDS, "luckperms-permission-vault");
|
||||
this.rootNode = new TreeNode();
|
||||
this.knownPermissions = ConcurrentHashMap.newKeySet(3000);
|
@ -52,7 +52,7 @@ public class TreeView {
|
||||
// the actual tree object
|
||||
private final ImmutableTreeNode view;
|
||||
|
||||
public TreeView(PermissionVault source, String rootPosition) {
|
||||
public TreeView(PermissionRegistry source, String rootPosition) {
|
||||
if (rootPosition.equals("") || rootPosition.equals("*")) {
|
||||
rootPosition = ".";
|
||||
} else if (!rootPosition.equals(".") && rootPosition.endsWith(".")) {
|
||||
@ -79,7 +79,7 @@ public class TreeView {
|
||||
* @param source the node source
|
||||
* @return the root, if it exists
|
||||
*/
|
||||
private static Optional<TreeNode> findRoot(String rootPosition, PermissionVault source) {
|
||||
private static Optional<TreeNode> findRoot(String rootPosition, PermissionRegistry source) {
|
||||
// get the root of the permission vault
|
||||
TreeNode root = source.getRootNode();
|
||||
|
||||
|
@ -103,7 +103,7 @@ public final class WebEditor {
|
||||
)
|
||||
.add("knownPermissions", new JArray()
|
||||
.consume(arr -> {
|
||||
for (String perm : plugin.getPermissionVault().rootAsList()) {
|
||||
for (String perm : plugin.getPermissionRegistry().rootAsList()) {
|
||||
arr.add(perm);
|
||||
}
|
||||
})
|
||||
|
@ -72,7 +72,7 @@ public class MonitoredPermissibleBase extends PermissibleBase {
|
||||
|
||||
private void logCheck(CheckOrigin origin, String permission, boolean result) {
|
||||
this.plugin.getVerboseHandler().offerCheckData(origin, this.name, ContextSet.empty(), permission, Tristate.fromBoolean(result));
|
||||
this.plugin.getPermissionVault().offer(permission);
|
||||
this.plugin.getPermissionRegistry().offer(permission);
|
||||
}
|
||||
|
||||
PermissibleBase getDelegate() {
|
||||
|
@ -32,7 +32,7 @@ import com.google.common.collect.ForwardingMap;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import me.lucko.luckperms.common.plugin.LuckPermsPlugin;
|
||||
import me.lucko.luckperms.common.treeview.PermissionVault;
|
||||
import me.lucko.luckperms.common.treeview.PermissionRegistry;
|
||||
|
||||
import cn.nukkit.permission.Permission;
|
||||
import cn.nukkit.plugin.PluginManager;
|
||||
@ -50,7 +50,7 @@ import javax.annotation.Nonnull;
|
||||
*
|
||||
* This instance allows LuckPerms to intercept calls to
|
||||
* {@link PluginManager#addPermission(Permission)} and record permissions in the
|
||||
* {@link PermissionVault}.
|
||||
* {@link PermissionRegistry}.
|
||||
*
|
||||
* It also allows us to pre-determine child permission relationships.
|
||||
*
|
||||
@ -94,7 +94,7 @@ public final class LPPermissionMap extends ForwardingMap<String, Permission> {
|
||||
|
||||
@Override
|
||||
public Permission put(@Nonnull String key, @Nonnull Permission value) {
|
||||
this.plugin.getPermissionVault().offer(key);
|
||||
this.plugin.getPermissionRegistry().offer(key);
|
||||
Permission ret = super.put(key, value);
|
||||
update();
|
||||
return ret;
|
||||
@ -102,14 +102,14 @@ public final class LPPermissionMap extends ForwardingMap<String, Permission> {
|
||||
|
||||
@Override
|
||||
public void putAll(@Nonnull Map<? extends String, ? extends Permission> m) {
|
||||
this.plugin.getPermissionVault().offerAll(m.keySet());
|
||||
this.plugin.getPermissionRegistry().offerAll(m.keySet());
|
||||
super.putAll(m);
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Permission putIfAbsent(String key, Permission value) {
|
||||
this.plugin.getPermissionVault().offer(key);
|
||||
this.plugin.getPermissionRegistry().offer(key);
|
||||
Permission ret = super.putIfAbsent(key, value);
|
||||
update();
|
||||
return ret;
|
||||
|
@ -94,7 +94,7 @@ public final class DescriptionBuilder implements PermissionDescription.Builder {
|
||||
roleSubject.getTransientSubjectData().setPermission(ContextSet.empty(), this.id, assignment.getValue());
|
||||
}
|
||||
|
||||
this.service.getPlugin().getPermissionVault().offer(this.id);
|
||||
this.service.getPlugin().getPermissionRegistry().offer(this.id);
|
||||
|
||||
// null stuff so this instance can be reused
|
||||
this.roles.clear();
|
||||
|
@ -94,7 +94,7 @@ public final class DescriptionBuilder implements PermissionDescription.Builder {
|
||||
roleSubject.getTransientSubjectData().setPermission(ContextSet.empty(), this.id, assignment.getValue());
|
||||
}
|
||||
|
||||
this.service.getPlugin().getPermissionVault().offer(this.id);
|
||||
this.service.getPlugin().getPermissionRegistry().offer(this.id);
|
||||
|
||||
// null stuff so this instance can be reused
|
||||
this.roles.clear();
|
||||
|
@ -43,6 +43,7 @@ import me.lucko.luckperms.common.sender.DummySender;
|
||||
import me.lucko.luckperms.common.sender.Sender;
|
||||
import me.lucko.luckperms.common.tasks.CacheHousekeepingTask;
|
||||
import me.lucko.luckperms.common.tasks.ExpireTemporaryTask;
|
||||
import me.lucko.luckperms.common.treeview.PermissionRegistry;
|
||||
import me.lucko.luckperms.sponge.calculators.SpongeCalculatorFactory;
|
||||
import me.lucko.luckperms.sponge.commands.SpongeMainCommand;
|
||||
import me.lucko.luckperms.sponge.contexts.SpongeContextManager;
|
||||
@ -60,6 +61,7 @@ import me.lucko.luckperms.sponge.service.persisted.PersistedCollection;
|
||||
import me.lucko.luckperms.sponge.tasks.ServiceCacheHousekeepingTask;
|
||||
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.service.permission.PermissionDescription;
|
||||
import org.spongepowered.api.service.permission.PermissionService;
|
||||
import org.spongepowered.api.service.permission.Subject;
|
||||
|
||||
@ -151,6 +153,11 @@ public class LPSpongePlugin extends AbstractLuckPermsPlugin {
|
||||
this.updateEventHandler = UpdateEventHandler.obtain(this);
|
||||
this.service = new LuckPermsService(this);
|
||||
|
||||
// before registering our permission service, copy any existing permission descriptions
|
||||
PermissionRegistry permissionRegistry = getPermissionRegistry();
|
||||
this.bootstrap.getGame().getServiceManager().provide(PermissionService.class)
|
||||
.ifPresent(ps -> ps.getDescriptions().stream().map(PermissionDescription::getId).forEach(permissionRegistry::offer));
|
||||
|
||||
if (this.bootstrap.getGame().getPluginManager().getPlugin("permissionsex").isPresent()) {
|
||||
getLogger().warn("Detected PermissionsEx - assuming it's loaded for migration.");
|
||||
getLogger().warn("Delaying LuckPerms PermissionService registration.");
|
||||
|
@ -55,10 +55,10 @@ import org.spongepowered.api.service.permission.Subject;
|
||||
import org.spongepowered.api.text.Text;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@ -95,7 +95,7 @@ public class LuckPermsService implements LPPermissionService {
|
||||
/**
|
||||
* A set of registered permission description instances
|
||||
*/
|
||||
private final Set<LPPermissionDescription> permissionDescriptions;
|
||||
private final Map<String, LPPermissionDescription> permissionDescriptions;
|
||||
|
||||
/**
|
||||
* The loaded collections in this service
|
||||
@ -107,7 +107,7 @@ public class LuckPermsService implements LPPermissionService {
|
||||
this.plugin = plugin;
|
||||
this.referenceFactory = new SubjectReferenceFactory(this);
|
||||
this.spongeProxy = ProxyFactory.toSponge(this);
|
||||
this.permissionDescriptions = ConcurrentHashMap.newKeySet();
|
||||
this.permissionDescriptions = new ConcurrentHashMap<>();
|
||||
|
||||
// init subject storage
|
||||
this.storage = new SubjectStorage(this, new File(plugin.getBootstrap().getDataDirectory(), "sponge-data"));
|
||||
@ -199,37 +199,30 @@ public class LuckPermsService implements LPPermissionService {
|
||||
@Override
|
||||
public LPPermissionDescription registerPermissionDescription(String id, Text description, PluginContainer owner) {
|
||||
SimplePermissionDescription desc = new SimplePermissionDescription(this, id, description, owner);
|
||||
this.permissionDescriptions.add(desc);
|
||||
this.permissionDescriptions.put(id, desc);
|
||||
this.plugin.getPermissionRegistry().offer(id);
|
||||
return desc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<LPPermissionDescription> getDescription(String s) {
|
||||
Objects.requireNonNull(s);
|
||||
for (LPPermissionDescription d : this.permissionDescriptions) {
|
||||
if (d.getId().equals(s)) {
|
||||
return Optional.of(d);
|
||||
}
|
||||
}
|
||||
|
||||
return Optional.empty();
|
||||
return Optional.ofNullable(this.permissionDescriptions.get(s));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImmutableSet<LPPermissionDescription> getDescriptions() {
|
||||
Set<LPPermissionDescription> descriptions = new HashSet<>(this.permissionDescriptions);
|
||||
Map<String, LPPermissionDescription> descriptions = new HashMap<>(this.permissionDescriptions);
|
||||
|
||||
// collect known values from the permission vault
|
||||
for (String knownPermission : this.plugin.getPermissionVault().getKnownPermissions()) {
|
||||
LPPermissionDescription desc = new SimplePermissionDescription(this, knownPermission, null, null);
|
||||
|
||||
for (String perm : this.plugin.getPermissionRegistry().getKnownPermissions()) {
|
||||
// don't override plugin defined values
|
||||
if (!descriptions.contains(desc)) {
|
||||
descriptions.add(desc);
|
||||
if (!descriptions.containsKey(perm)) {
|
||||
descriptions.put(perm, new SimplePermissionDescription(this, perm, null, null));
|
||||
}
|
||||
}
|
||||
|
||||
return ImmutableSet.copyOf(descriptions);
|
||||
return ImmutableSet.copyOf(descriptions.values());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user