Add policy_rules to aggregates dashboard

This patch set adds in os_compute_api:os-aggregates policies in the
appropriate dashboards.

Change-Id: Id31388e4c7fa3093e31da0479635f5610e378da5
Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
Tin Lam 2019-11-15 09:29:52 -06:00
parent 201b5380d5
commit e3fc37188d
2 changed files with 9 additions and 0 deletions

View File

@ -21,6 +21,8 @@ from openstack_dashboard.dashboards.admin.aggregates import constants
class DeleteAggregateAction(tables.DeleteAction): class DeleteAggregateAction(tables.DeleteAction):
policy_rules = (("compute", "os_compute_api:os-aggregates:delete"),)
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ungettext_lazy(
@ -51,6 +53,7 @@ class CreateAggregateAction(tables.LinkAction):
verbose_name = _("Create Host Aggregate") verbose_name = _("Create Host Aggregate")
url = constants.AGGREGATES_CREATE_URL url = constants.AGGREGATES_CREATE_URL
classes = ("ajax-modal",) classes = ("ajax-modal",)
policy_rules = (("compute", "os_compute_api:os-aggregates:create"),)
icon = "plus" icon = "plus"
@ -66,6 +69,7 @@ class UpdateMetadataAction(tables.LinkAction):
name = "update-metadata" name = "update-metadata"
verbose_name = _("Update Metadata") verbose_name = _("Update Metadata")
ajax = False ajax = False
policy_rules = (("compute", "os_compute_api:os-aggregates:set_metadata"),)
icon = "pencil" icon = "pencil"
attrs = {"ng-controller": "MetadataModalHelperController as modal"} attrs = {"ng-controller": "MetadataModalHelperController as modal"}
@ -85,6 +89,7 @@ class UpdateAggregateAction(tables.LinkAction):
verbose_name = _("Edit Host Aggregate") verbose_name = _("Edit Host Aggregate")
url = constants.AGGREGATES_UPDATE_URL url = constants.AGGREGATES_UPDATE_URL
classes = ("ajax-modal",) classes = ("ajax-modal",)
policy_rules = (("compute", "os_compute_api:os-aggregates:update"),)
icon = "pencil" icon = "pencil"

View File

@ -0,0 +1,4 @@
---
fixes:
- |
The missing nova's os-aggregates policy rules are added to the dashboard.