Reviewed: https://review.openstack.org/288814 Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=a2c1a0a33b92a7ff7c7a14e0da78aabd243267b7 Submitter: Jenkins Branch: master
commit a2c1a0a33b92a7ff7c7a14e0da78aabd243267b7 Author: daniel-a-nguyen <[email protected]> Date: Fri Mar 4 16:18:19 2016 -0800 Disable Glance option to publicize image on Update 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}) Closes-Bug: #1553420 Change-Id: I9c441252f7959e169eedbf432d140f9415d1a32b ** Changed in: horizon Status: In Progress => Fix Released -- 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): Fix Released 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 -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

