iteration

This commit is contained in:
Layla 2023-10-08 05:25:17 -04:00
parent 3035d7563f
commit 30dd8e8070

View File

@ -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 <user> <group>\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 <list:check:add>\n")
return
end
end