Merge "Update attach_volume and detach_volume policy rules"
This commit is contained in:
commit
1770eda114
@ -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
|
||||
|
@ -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})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user