Yair Zaslavsky has uploaded a new change for review. Change subject: [WIP] core: template can't be seen by user ......................................................................
[WIP] core: template can't be seen by user The user_vm_template_permissions_view_base has a bug - for the case user has permission on data center it returns the vmt_guid as the entity id - but for templates - vmt_guid is zero guid. What should be returned is the vm_guid (which is the template id) Marking as WIP as still need to test the scenario where template has no disks, as stated in bug Bug-Url: https://bugzilla.redhat.com/921450 Change-Id: I624eb8724da81bbffe0c4db973f67800c2593e3b Signed-off-by: Yair Zaslavsky <yzasl...@redhat.com> --- M backend/manager/dbscripts/create_views.sql 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/80/13180/1 diff --git a/backend/manager/dbscripts/create_views.sql b/backend/manager/dbscripts/create_views.sql index b09febd..e73e3b2 100644 --- a/backend/manager/dbscripts/create_views.sql +++ b/backend/manager/dbscripts/create_views.sql @@ -1321,10 +1321,10 @@ INNER JOIN internal_permissions_view ON object_id = vm_static.vm_guid AND object_type_id = 2 AND role_type = 2 -- Or the user has permissions on the data center containing the template UNION ALL -SELECT vmt_guid, ad_element_id +SELECT vm_guid, ad_element_id FROM vm_static INNER JOIN vds_groups ON vds_groups.vds_group_id = vm_static.vds_group_id -INNER JOIN internal_permissions_view ON object_id = storage_pool_id AND object_type_id = 14 AND allows_viewing_children AND role_type = 2 +INNER JOIN internal_permissions_view ON object_id = storage_pool_id AND object_type_id = 14 AND allows_viewing_children AND role_type = 2 AND vm_static.entity_type::text = 'TEMPLATE'::text -- Or the user has permissions on system UNION ALL SELECT vm_guid, ad_element_id -- To view, visit http://gerrit.ovirt.org/13180 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I624eb8724da81bbffe0c4db973f67800c2593e3b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches