Fix single policy rule handling
With commit 43e9df85ab
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
This commit is contained in:
parent
4f13234118
commit
5bce9a0250
@ -153,7 +153,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
Block a user