Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
fix: Fix conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
robsavoye committed Mar 24, 2024
1 parent 51fb223 commit 1e68d8d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tm_admin/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1e68d8d

Please sign in to comment.