From 816c154a45f6ee0941a756c413d3dbcaa41c047b Mon Sep 17 00:00:00 2001 From: vexyl Date: Tue, 7 Aug 2018 06:36:20 -0400 Subject: [PATCH] Fix permission ordering in world plugin --- plugins/core/permissions.lua | 2 +- plugins/essentials/ban.lua | 2 +- plugins/essentials/groups.lua | 5 +++++ plugins/essentials/world.lua | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/core/permissions.lua b/plugins/core/permissions.lua index abfd90a..e5c35f4 100644 --- a/plugins/core/permissions.lua +++ b/plugins/core/permissions.lua @@ -186,7 +186,7 @@ end PermissionsPlugin.RequirePermission = function(permission) table.insert(PermissionsPlugin.permissionList, permission) - print("PermissionsPlugin new permission: " .. permission) + Server.LogDebug("PermissionsPlugin new permission: " .. permission) end PermissionsPlugin.PermissionExists = function(permission) diff --git a/plugins/essentials/ban.lua b/plugins/essentials/ban.lua index 03c4914..f68465b 100644 --- a/plugins/essentials/ban.lua +++ b/plugins/essentials/ban.lua @@ -130,7 +130,7 @@ EssentialsPlugin.Ban_OnConnect = function(client, args) end Server.KickClient(client, message) - print("Ban plugin prevented player " .. name .. " from joining.") + Server.LogDebug("Ban plugin prevented player " .. name .. " from joining.") Flags.NoDefaultCall = 1 end end diff --git a/plugins/essentials/groups.lua b/plugins/essentials/groups.lua index 07c2583..a4fd64d 100644 --- a/plugins/essentials/groups.lua +++ b/plugins/essentials/groups.lua @@ -21,6 +21,11 @@ EssentialsPlugin.Groups_GroupsCommand_Reload = function(client, args) EssentialsPlugin.Groups_LoadGroups() Server.SendMessage(client, "&eReloaded groups") + + -- hack to reload current players + for _,v in pairs(Server.GetClients()) do + EssentialsPlugin.Groups_OnAuth(v, nil) + end end EssentialsPlugin.Groups_OnAuth = function(client, args) diff --git a/plugins/essentials/world.lua b/plugins/essentials/world.lua index aaec197..181c2da 100644 --- a/plugins/essentials/world.lua +++ b/plugins/essentials/world.lua @@ -23,8 +23,8 @@ Init = function() end, HasWorldPermission = function(client) - return PermissionsPlugin.CheckPermissionNotify(client, client:GetWorld():GetName() .. ".admin") - or PermissionsPlugin.CheckPermissionIfExists(client.name, "essentials.world") + return PermissionsPlugin.CheckPermissionIfExists(client.name, "essentials.world") + or PermissionsPlugin.CheckPermissionNotify(client, client:GetWorld():GetName() .. ".admin") end, Event_OnBlock = function(client, block)