-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix listing metrics as non-admin without creator policy defined
When using a minimal RBAC policy that only allows either access either to a cloud admin or a user that is part of the project a metric's resource is owned by, e.g. ```yaml "list metric": "role:admin or project_id:%(resource.project_id)s" ``` There is an issue where `KeystoneAuthHelper.get_metric_policy_filter` will reject access to the metrics because from its perspective there are no applicable policies that the user has permission under. This patch fixes that by adding an option to `get_metric_policy_filter` that allows an empty policy filter to be returned if an enforcement check for `resource.project_id` passes. This option is set to `False` by default, and only enabled where necessary. This allows the caller to use `KeystoneAuthHelper.get_resource_policy_filter` to add project filters to the metric query based on the resource the metric is associated with.
- Loading branch information
Showing
3 changed files
with
104 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters