From 1e68d8dcef3bbf1ed4737c4f9221a9500ca5167d Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sun, 24 Mar 2024 08:14:53 -0600 Subject: [PATCH] fix: Fix conditional --- tm_admin/access.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tm_admin/access.py b/tm_admin/access.py index cc9fbfb..dd8998f 100755 --- a/tm_admin/access.py +++ b/tm_admin/access.py @@ -113,11 +113,10 @@ def __init__(self, # print(json.dumps(self.permissions, indent=4)) # print("------------------") for k, v in self.permissions.items(): - print(k) if 'children' in v: # print(f"CHILD: {k} = {v['children']}") self.rbac.create_role(k, children=v['children']) - elif 'tables' in v: + if 'tables' in v: print(f"TABLE: {k} = {v['tables']}") for table in v['tables']: log.debug(f"Adding permission '{v['access']}' for '{k.upper()}' on '{table}'") @@ -181,7 +180,7 @@ async def main(): await acl.check('tasks', Roles.MAPPER, Operation.READ) await acl.check('messages', Roles.MAPPER, Operation.READ) await acl.check('campaigns', Roles.MAPPER, Operation.READ) - await acl.check('campaigns', Roles.MAPPER, Operation.CREATE) + # await acl.check('campaigns', Roles.MAPPER, Operation.CREATE) await acl.check('projects', Roles.VALIDATOR, Operation.UPDATE) # await acl.check('tasks', Roles.VALIDATOR, Operation.UPDATE)