-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Description
Hi @Turall
For cases where there is more than one rule within a policy, the following functions don't appear to work as expected:
- check_permission
- get_policies_info
In both cases, it will only return one rule. It seems the issue lies with an if statement, e.g.:
# problem code
for rule in result.get('ast').get('rules'):
if not rule.get('default'):
continue
if rule.get('head').get('name') == rule_name:
permission_url += '/' + rule.get('head').get('name')
find = TrueAs additional rules are not considered default, it will skip them completely (at least that's what I think). As a proposed solution, suggest the following:
# solution code
rules = [rule.get("head").get("name") for rule in result.get("ast").get("rules")]
if rule_name in rules:
permission_url += "/" + rule_name
find = TrueI will raise a PR for you to review.
Many thanks
Metadata
Metadata
Assignees
Labels
No labels