mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-26 12:35:39 +01:00
Fixes #1678 anchor list doesn't obey enforceaccess
(cherry picked from commit 46359cfbfe
)
This commit is contained in:
parent
c85c68f816
commit
478da03d48
@ -140,8 +140,17 @@ public class AnchorManager {
|
||||
if (ancLoc == null) {
|
||||
continue;
|
||||
}
|
||||
if (p.hasPermission("multiverse.access." + ancLoc.getWorld().getName())) {
|
||||
String worldPerm = "multiverse.access." + ancLoc.getWorld().getName();
|
||||
// Add to the list if we're not enforcing access
|
||||
// OR
|
||||
// We are enforcing access and the user has the permission.
|
||||
if (!this.plugin.getMVConfig().getEnforceAccess() ||
|
||||
(this.plugin.getMVConfig().getEnforceAccess() && p.hasPermission(worldPerm))) {
|
||||
myAnchors.add(anchor);
|
||||
} else {
|
||||
Logging.finer(String.format("Not adding anchor %s to the list, user %s doesn't have the %s " +
|
||||
"permission and 'enforceaccess' is enabled!",
|
||||
anchor, p.getName(), worldPerm));
|
||||
}
|
||||
}
|
||||
return Collections.unmodifiableSet(myAnchors);
|
||||
|
Loading…
Reference in New Issue
Block a user