mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-09-12 05:08:48 +00:00
Fixed an issue with superperms where plugins define perms with
inheritance after the root perms
This commit is contained in:
parent
ab67d0e232
commit
0462026f33
|
@ -23,4 +23,5 @@ v 1.1:
|
||||||
- Fix for GM not checking inheritance for known superperms nodes.
|
- Fix for GM not checking inheritance for known superperms nodes.
|
||||||
- Optimized getAllPlayersPermissions and fixed pushing unknown perms to superperms.
|
- Optimized getAllPlayersPermissions and fixed pushing unknown perms to superperms.
|
||||||
v 1.2:
|
v 1.2:
|
||||||
- Changed priority if Registered events to lowest.
|
- Changed priority of Registered events to lowest.
|
||||||
|
- Fixed an issue with superperms where plugins define perms with inheritance after the root perms
|
|
@ -18,6 +18,7 @@ public class BukkitPermsUpdateTask implements Runnable {
|
||||||
public void run() {
|
public void run() {
|
||||||
// Signal loaded and update BukkitPermissions.
|
// Signal loaded and update BukkitPermissions.
|
||||||
GroupManager.setLoaded(true);
|
GroupManager.setLoaded(true);
|
||||||
|
GroupManager.BukkitPermissions.collectPermissions();
|
||||||
GroupManager.BukkitPermissions.updateAllPlayers();
|
GroupManager.BukkitPermissions.updateAllPlayers();
|
||||||
|
|
||||||
GroupManager.logger.info("Bukkit Permissions Updated!");
|
GroupManager.logger.info("Bukkit Permissions Updated!");
|
||||||
|
|
|
@ -93,7 +93,7 @@ public class BukkitPermissions {
|
||||||
manager.registerEvent(Event.Type.PLUGIN_DISABLE, serverListener, Event.Priority.Normal, plugin);
|
manager.registerEvent(Event.Type.PLUGIN_DISABLE, serverListener, Event.Priority.Normal, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void collectPermissions() {
|
public void collectPermissions() {
|
||||||
registeredPermissions.clear();
|
registeredPermissions.clear();
|
||||||
for (Plugin bukkitPlugin : Bukkit.getServer().getPluginManager().getPlugins()) {
|
for (Plugin bukkitPlugin : Bukkit.getServer().getPluginManager().getPlugins()) {
|
||||||
for(Permission permission : bukkitPlugin.getDescription().getPermissions())
|
for(Permission permission : bukkitPlugin.getDescription().getPermissions())
|
||||||
|
@ -134,7 +134,7 @@ public class BukkitPermissions {
|
||||||
Boolean value;
|
Boolean value;
|
||||||
for (Permission permission : registeredPermissions) {
|
for (Permission permission : registeredPermissions) {
|
||||||
value = worldData.getPermissionsHandler().checkUserPermission(user, permission.getName());
|
value = worldData.getPermissionsHandler().checkUserPermission(user, permission.getName());
|
||||||
|
if (value == true)
|
||||||
attachment.setPermission(permission, value);
|
attachment.setPermission(permission, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue