From 167938c7f1babaa06556cf586dce476808a46dc4 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Mon, 28 Feb 2022 08:07:52 +1100 Subject: [PATCH] feat(acl): add exports to set acl permissions Needing to grant multiple resources permissions to use this commands is no bueno. --- resource/acl/server.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 resource/acl/server.lua diff --git a/resource/acl/server.lua b/resource/acl/server.lua new file mode 100644 index 0000000..9d65908 --- /dev/null +++ b/resource/acl/server.lua @@ -0,0 +1,20 @@ +local function allowAce(allow) + return allow == false and 'deny' or 'allow' +end + +function lib.addAce(principal, ace, allow) + ExecuteCommand(('add_ace %s %s %s'):format(principal, ace, allowAce(allow))) +end + +function lib.removeAce(principal, ace, allow) + ExecuteCommand(('remove_ace %s %s %s'):format(principal, ace, allowAce(allow))) +end + +function lib.addPrincipal(child, parent) + ExecuteCommand(('add_principal %s %s'):format(child, parent)) +end + + +function lib.removePrincipal(child, parent) + ExecuteCommand(('remove_principal %s %s'):format(child, parent)) +end