Skip to content

Commit 72fd552

Browse files
committed
Bypass offline permission check
1 parent 4ec4cd0 commit 72fd552

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user/AdvancedCoreUser.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,10 @@ public boolean hasLoggedOnBefore() {
687687
}
688688

689689
public boolean hasPermission(String perm) {
690+
return hasPermission(perm, true);
691+
}
692+
693+
public boolean hasPermission(String perm, boolean offlineCheck) {
690694
boolean negate = perm != null && perm.startsWith("!");
691695
if (negate) {
692696
perm = perm.substring(1);
@@ -703,6 +707,11 @@ public boolean hasPermission(String perm) {
703707
return negate ? !has : has;
704708
}
705709

710+
if (!offlineCheck) {
711+
plugin.debug("Unable to get player for permission check for " + getPlayerName() + "/" + getUUID()
712+
+ " (offlineCheck is false)");
713+
return false;
714+
}
706715
// Offline path: LuckPerms (if available)
707716
if (plugin.getLuckPermsHandle() != null && plugin.getLuckPermsHandle().luckpermsApiLoaded()) {
708717
boolean has = plugin.getLuckPermsHandle().hasPermission(getJavaUUID(), perm);

0 commit comments

Comments
 (0)