From 30dd8e80700744e0638eb0d17b1f57fc62b5fe2a Mon Sep 17 00:00:00 2001 From: Layla Manley Date: Sun, 8 Oct 2023 05:25:17 -0400 Subject: [PATCH] iteration --- packages/auth.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/auth.lua b/packages/auth.lua index 1ad4d1d..7b4f434 100644 --- a/packages/auth.lua +++ b/packages/auth.lua @@ -111,5 +111,22 @@ elseif action == "group" then end local result = auth.add_user_to_group(target_user, group) + elseif subaction == "check" then + local target_user = args[3] + local group = args[4] + if target_user == nil or group == nil then + io.write("Usage: auth group check \n") + return + end + + local result = auth.check_user_in_group(target_user, group) + if result then + io.write("User " .. target_user .. " is in group " .. group .. "\n") + else + io.write("User " .. target_user .. " is not in group " .. group .. "\n") + end + else + io.write("Usage: auth group \n") + return end end \ No newline at end of file