added consent module, nesting mdoules now functional!

This commit is contained in:
Luke Miller
2021-12-16 16:52:06 -05:00
parent 0b265d7be5
commit 48123b3496
6 changed files with 100 additions and 42 deletions

View File

@@ -1,31 +0,0 @@
dofile("../modpol.lua")
print('\nRemoving existing orgs')
modpol.orgs.reset()
print('\nCreating an org called "test_org"')
test_org = modpol.instance:add_org('test_org', 'luke')
print('\nAdding user "nathan" to test_org')
test_org:add_member('nathan')
print("\nOkay, let's start with requests. Setting up an org...")
modpol.instance:add_org('test_org', 'luke')
test_org:add_member('nathan')
print('\nMaking consent the add_member policy')
test_org:set_policy("add_member", "consent", false);
print('\nMaking a request to add Josh')
add_josh = {
user = "josh",
type = "add_member",
params = {"josh"}
}
request_id = test_org:make_request(add_josh)
print('\nHave the two members vote on it')
modpol.interactions.org_dashboard("nathan","test_org")
modpol.interactions.org_dashboard("luke","test_org")

View File

@@ -0,0 +1,13 @@
dofile('../modpol.lua');
modpol.orgs.reset()
test_org = modpol.instance:add_org('test_org', 'luke')
test_org:add_member('nathan')
print(table.concat(test_org:list_members(), ", "))
test_org:call_module(
"join_org_consent",
"paul"
)