← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1553420] [NEW] Disabling the Publicizing of Glance Image does not work.

 

Public bug reported:

The Glance policy file contains a property that controls the ability to
publicize a Glance Image.  In Horizon we use this policy check to Hide
the checkbox on Project > Images > Create Image.  This is working as
expected.

For Updating an Image we attempt to make the Public checkbox read-only
which isn't enough to disable it.

To test try the following:

1) Update the glance_policy.json file in Horizon (located here horizon/openstack_dashboard/conf/) to reflect this rule:
...   
 "publicize_image": "role:admin",
...
2) Create a non-admin user and try to Create a new Glance Image
3) Observe that there is no Public check box.
4) This is expected.
5) Continue creating the image.
6) Once the image is created, Click on Edit Image
7) Notice that Public checkbox is there and you can select it.
8) This is not expected.

Expected Behavior:
For the Edit Image modal, the checkbox should be disabled like this.

https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/images/images/forms.py#L344

        if not policy.check((("image", "publicize_image"),), request):
            self.fields['public'].widget = forms.CheckboxInput(
                attrs={'readonly': 'readonly', 'disabled': disabled})

** Affects: horizon
     Importance: Undecided
     Assignee: Dan Nguyen (daniel-a-nguyen)
         Status: New

** Changed in: horizon
     Assignee: (unassigned) => Dan Nguyen (daniel-a-nguyen)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1553420

Title:
  Disabling the Publicizing of Glance Image does not work.

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  The Glance policy file contains a property that controls the ability
  to publicize a Glance Image.  In Horizon we use this policy check to
  Hide the checkbox on Project > Images > Create Image.  This is working
  as expected.

  For Updating an Image we attempt to make the Public checkbox read-only
  which isn't enough to disable it.

  To test try the following:

  1) Update the glance_policy.json file in Horizon (located here horizon/openstack_dashboard/conf/) to reflect this rule:
  ...   
   "publicize_image": "role:admin",
  ...
  2) Create a non-admin user and try to Create a new Glance Image
  3) Observe that there is no Public check box.
  4) This is expected.
  5) Continue creating the image.
  6) Once the image is created, Click on Edit Image
  7) Notice that Public checkbox is there and you can select it.
  8) This is not expected.

  Expected Behavior:
  For the Edit Image modal, the checkbox should be disabled like this.

  https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/project/images/images/forms.py#L344

          if not policy.check((("image", "publicize_image"),), request):
              self.fields['public'].widget = forms.CheckboxInput(
                  attrs={'readonly': 'readonly', 'disabled': disabled})

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1553420/+subscriptions


Follow ups