Skip to content

Commit

Permalink
I almost broke every single existing setup
Browse files Browse the repository at this point in the history
  • Loading branch information
A248 committed Aug 19, 2023
1 parent c8af256 commit fdfd08e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ private MessagesConfig.All.NotFound notFound() {

@Override
public <R> @Nullable R parseScope(CmdSender sender, CommandPackage command, ParseScope<R> how) {

boolean requirePermissions = configs.getScopeConfig().requirePermissions();
ServerScope explicitScope;
String specificServer, category, rawScopeInput;

Expand All @@ -176,7 +178,7 @@ private MessagesConfig.All.NotFound notFound() {
}
explicitScope = parsed.get();
} else {
if (!sender.hasPermission("libertybans.scope.default")) {
if (requirePermissions & !sender.hasPermission("libertybans.scope.default")) {
sender.sendMessage(all().scopes().noPermissionForDefault());
return null;
}
Expand All @@ -189,7 +191,7 @@ private MessagesConfig.All.NotFound notFound() {
case CATEGORY -> "category." + value;
};
});
if (!sender.hasPermission("libertybans.scope." + permissionSuffix)) {
if (requirePermissions && !sender.hasPermission("libertybans.scope." + permissionSuffix)) {
sender.sendMessage(all().scopes().noPermission().replaceText("%SCOPE%", formatter.formatScope(explicitScope)));
return null;
}
Expand Down

0 comments on commit fdfd08e

Please sign in to comment.