More basic functionality for policy change

Created change_policy module (though it still does not have an
approval flow; improved display_policies and display_processes modules.
This commit is contained in:
Nathan Schneider
2022-02-06 22:04:07 -07:00
parent 9d4ad377e6
commit f950b5b94c
4 changed files with 132 additions and 24 deletions

View File

@ -20,28 +20,25 @@ display_policies.config = {
function display_policies:initiate(result)
local display_table = {}
for k,v in pairs(self.org.modules) do
if v ~= "deleted" then
local input = v.name
table.insert(display_table, input)
if v.config
and modpol.util.num_pairs(v.config) > 0 then
table.insert(display_table, "Policies:")
for k2,v2 in pairs(v.config) do
local v2_string = ""
if type(v2) ~= "string"
and type(v2) ~= "table" then
v2_string = tostring(v2)
elseif type(v2) == "table" then
v2_string = tostring(v2)
else
v2_string = "Could not render"
end
input = k2..": "..v2_string
table.insert(display_table, input)
local input = v.name
table.insert(display_table, input)
if v.config
and modpol.util.num_pairs(v.config) > 0 then
for k2,v2 in pairs(v.config) do
local v2_string = ""
if type(v2) == "string" then
v2_string = v2
elseif type(v2) == "table"
or type(v2) == "number" then
v2_string = tostring(v2)
else
v2_string = "Could not render"
end
input = k2..": "..v2_string
table.insert(display_table, input)
end
table.insert(display_table, "\n")
end
table.insert(display_table, "---")
end
local output = table.concat(display_table,"\n")
if #display_table == 0 then