Fix single policy rule handling
With commit43e9df85ab
the handling of single policy rules was broken and always returned True for a single rule. One of the visible results is that the Admin Dashboard showed up incorrectly for users that lacked permission to see it. Additionally, panel in the Admin Dashboard were also visible. This patch fixes single rule handling, and the visible effects. Closes-Bug: #1653792 Change-Id: I0c8a0d7b230b6c6b7ee048af84646ca95daee340 (cherry picked from commit5bce9a0250
)
This commit is contained in:
parent
87ae58b95e
commit
8d9665302a
|
@ -152,7 +152,7 @@ class HorizonComponent(object):
|
|||
for rule in self.policy_rules:
|
||||
rule_param = rule
|
||||
if not any(isinstance(r, (list, tuple)) for r in rule):
|
||||
rule_param = list(rule)
|
||||
rule_param = (rule,)
|
||||
if policy_check(rule_param, request):
|
||||
return True
|
||||
return False
|
||||
|
|
Loading…
Reference in New Issue