diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py index 3f13d00512..324430bafc 100644 --- a/openstack_dashboard/dashboards/project/instances/tables.py +++ b/openstack_dashboard/dashboards/project/instances/tables.py @@ -893,7 +893,7 @@ class AttachVolume(tables.LinkAction): url = "horizon:project:instances:attach_volume" classes = ("ajax-modal",) policy_rules = ( - ("compute", "os_compute_api:servers:create:attach_volume"),) + ("compute", "os_compute_api:os-volumes-attachments:create"),) # This action should be disabled if the instance # is not active, or the instance is being deleted @@ -908,7 +908,8 @@ class DetachVolume(AttachVolume): name = "detach_volume" verbose_name = _("Detach Volume") url = "horizon:project:instances:detach_volume" - policy_rules = (("compute", "os_compute_api:servers:detach_volume"),) + policy_rules = ( + ("compute", "os_compute_api:os-volumes-attachments:delete"),) # This action should be disabled if the instance # is not active, or the instance is being deleted diff --git a/openstack_dashboard/dashboards/project/volumes/tables.py b/openstack_dashboard/dashboards/project/volumes/tables.py index a5800bd53f..8ae169e08d 100644 --- a/openstack_dashboard/dashboards/project/volumes/tables.py +++ b/openstack_dashboard/dashboards/project/volumes/tables.py @@ -188,12 +188,12 @@ class EditAttachments(tables.LinkAction): project_id = getattr(volume, "os-vol-tenant-attr:tenant_id", None) attach_allowed = \ policy.check((("compute", - "os_compute_api:servers:create:attach_volume"),), + "os_compute_api:os-volumes-attachments:create"),), request, {"project_id": project_id}) detach_allowed = \ policy.check((("compute", - "os_compute_api:servers:detach_volume"),), + "os_compute_api:os-volumes-attachments:delete"),), request, {"project_id": project_id})