Skip to content

Commit 0ce6cf1

Browse files
Fix: use at least permission level 2 when checking permissions using permissions API (#393)
This PR makes a small fix to an oversight I made in my 26.2 update PR (#391). I had accidentally removed the line of code that results in checking at least permission level 2 when checking permissions using the permissions API (see [this](https://github.com/John-Paul-R/Essential-Commands/blob/399e0504d3ff73c944ab8fcdde0d9d332a1f0f31/src/main/java/com/fibermc/essentialcommands/ECPerms.java#L136) line of code before the 26.2 update). This PR re-introduces that behaviour.
1 parent 2a35821 commit 0ce6cf1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/fibermc/essentialcommands/ECPerms.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static boolean check(@NotNull CommandSourceStack source, @NotNull Identif
138138
if (defaultRequireLevel > 4) {
139139
return source.checkPermission(permission, false);
140140
}
141-
return source.checkPermission(permission, PermissionLevel.byId(defaultRequireLevel));
141+
return source.checkPermission(permission, PermissionLevel.byId(Math.max(2, defaultRequireLevel)));
142142
} catch (Exception e) {
143143
EssentialCommands.LOGGER.error(e);
144144
return false;

0 commit comments

Comments
 (0)