diff --git a/api/src/main/java/net/md_5/bungee/api/CommandSender.java b/api/src/main/java/net/md_5/bungee/api/CommandSender.java index 4a8f6bcd..f549aa9f 100644 --- a/api/src/main/java/net/md_5/bungee/api/CommandSender.java +++ b/api/src/main/java/net/md_5/bungee/api/CommandSender.java @@ -82,4 +82,10 @@ public interface CommandSender * @param value the value of the node */ public void setPermission(String permission, boolean value); + + /** + * Get all Permissions which this CommandSender has + * @return a unmodifiable Collection of Strings which represent their permissions + */ + public Collection getPermissions(); } diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 762c91f2..109afea9 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -400,6 +400,12 @@ public final class UserConnection implements ProxiedPlayer } } + @Override + public Collection getPermissions() + { + return Collections.unmodifiableCollection(permissions); + } + @Override public String toString() { diff --git a/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java b/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java index d6e8b79f..49dde16f 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java +++ b/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java @@ -82,4 +82,10 @@ public class ConsoleCommandSender implements CommandSender { throw new UnsupportedOperationException( "Console has all permissions" ); } + + @Override + public Collection getPermissions() + { + return Collections.emptySet(); + } }