mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-03 01:19:58 +01:00
Do not grant any permissions (nort update Bukkit) if the server is in
offline mode and the player has the permission node 'groupmanager.noofflineperms'.
This commit is contained in:
parent
24f56892ad
commit
ad7009c77e
@ -207,3 +207,4 @@ v 2.0:
|
||||
- Clear our attachment map upon a manload so we correctly reconfigure a players new permissions.
|
||||
- Synchronize the raising of GroupManager events to Bukkit.getServer() (should prevent deadlocks).
|
||||
- Synchronize pushing to Bukkit perms to prevent any ConcurrentModificationException.
|
||||
- Do not grant any permissions (nort update Bukkit) if the server is in offline mode and the player has the permission node 'groupmanager.noofflineperms'.
|
@ -16,6 +16,7 @@ import org.anjocaido.groupmanager.data.Group;
|
||||
import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
|
||||
import org.anjocaido.groupmanager.data.User;
|
||||
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
@ -785,6 +786,15 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Do not push any perms to bukkit if...
|
||||
* We are in offline mode
|
||||
* and the player has the 'groupmanager.noofflineperms' permission.
|
||||
*/
|
||||
if (!Bukkit.getServer().getOnlineMode()
|
||||
&& (checkFullGMPermission(user, "groupmanager.noofflineperms", true).resultType == PermissionCheckResult.Type.FOUND))
|
||||
return result;
|
||||
|
||||
if (checkBukkit) {
|
||||
// Check Bukkit perms to support plugins which add perms via code
|
||||
// (Heroes).
|
||||
|
@ -31,7 +31,6 @@ import java.util.WeakHashMap;
|
||||
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.anjocaido.groupmanager.data.User;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@ -184,6 +183,18 @@ public class BukkitPermissions {
|
||||
newPerms.put((value ? permission : permission.substring(1)), value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Do not push any perms to bukkit if...
|
||||
* We are in offline mode
|
||||
* and the player has the 'groupmanager.noofflineperms' permission.
|
||||
*/
|
||||
if (!Bukkit.getServer().getOnlineMode()
|
||||
&& (newPerms.containsKey("groupmanager.noofflineperms") && (newPerms.get("groupmanager.noofflineperms") == true))) {
|
||||
removeAttachment(name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is put in place until such a time as Bukkit pull 466 is
|
||||
* implemented https://github.com/Bukkit/Bukkit/pull/466
|
||||
|
@ -3,13 +3,16 @@ users:
|
||||
snowleo:
|
||||
group: Builder
|
||||
subgroups: []
|
||||
permissions: []
|
||||
permissions:
|
||||
- groupmanager.noofflineperms
|
||||
KHobbits:
|
||||
group: Moderator
|
||||
subgroups: []
|
||||
permissions: []
|
||||
permissions:
|
||||
- groupmanager.noofflineperms
|
||||
ElgarL:
|
||||
group: Moderator
|
||||
subgroups: []
|
||||
permissions: []
|
||||
permissions:
|
||||
- groupmanager.noofflineperms
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user