Skip to content

Commit

Permalink
feat: more permissive child support
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Feb 25, 2021
1 parent 084970a commit 6c06b12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/appier_extras/parts/admin/models/account.py
Expand Up @@ -702,6 +702,8 @@ def tokens(self):
tokens.update(["base", "user"])

for role in self.roles_l:
if not hasattr(role, "tokens_a"): continue
if not role.tokens_a: continue
tokens.update(role.tokens_a)

if "*" in tokens: tokens = ["*"]
Expand Down
2 changes: 2 additions & 0 deletions src/appier_extras/parts/admin/models/role.py
Expand Up @@ -121,6 +121,8 @@ def view_m(self, context = None):
def tokens_a(self):
tokens = set(self.tokens)
for child in self.children:
if not hasattr(child, "tokens_a"): continue
if not child.tokens_a: continue
tokens.update(child.tokens_a)
return tokens

Expand Down

0 comments on commit 6c06b12

Please sign in to comment.