Oved Ourfali has uploaded a new change for review.

Change subject: core: Fix disk permission view (#849404)
......................................................................

core: Fix disk permission view (#849404)

https://bugzilla.redhat.com/show_bug.cgi?id=849404

This patch fixes the user disk permissions view, to contain disks from
SDs and DCs the user has permissions on. The problem is that the current
views return the image_id and not the image_group_id (disk id).

Change-Id: I6cf88c61b054b0e791c7e2c2e4313908dd7a2fc5
Signed-off-by: Oved Ourfali <[email protected]>
---
M backend/manager/dbscripts/create_views.sql
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/19/7319/1

diff --git a/backend/manager/dbscripts/create_views.sql 
b/backend/manager/dbscripts/create_views.sql
index 4f2e4fc..da54151 100644
--- a/backend/manager/dbscripts/create_views.sql
+++ b/backend/manager/dbscripts/create_views.sql
@@ -1289,15 +1289,17 @@
 WHERE      type = 'disk' and device = 'disk'
 -- Or the user has permissions on the storage domain containing the disk
 UNION ALL
-SELECT     image_id, ad_element_id
+SELECT     images.image_group_id, ad_element_id
 FROM       image_storage_domain_map
+INNER JOIN images ON images.image_guid = image_storage_domain_map.image_id
 INNER JOIN permissions_view ON object_id = storage_domain_id AND 
object_type_id = 11 AND allows_viewing_children AND role_type = 2
 -- Or the user has permissions on the data center containing the storage pool 
constaining the disk
 UNION ALL
-SELECT     image_id, ad_element_id
+SELECT     images.image_group_id, ad_element_id
 FROM       image_storage_domain_map
 INNER JOIN storage_pool_iso_map ON image_storage_domain_map.storage_domain_id 
= storage_pool_iso_map.storage_id
-INNER JOIN permissions_view ON object_id = storage_id AND object_type_id = 11 
AND allows_viewing_children AND role_type = 2
+INNER JOIN images ON images.image_guid = image_storage_domain_map.image_id
+INNER JOIN permissions_view ON object_id = storage_pool_id AND object_type_id 
= 14 AND allows_viewing_children AND role_type = 2
 -- Or the user has permissions on system
 UNION ALL
 SELECT     device_id, ad_element_id


--
To view, visit http://gerrit.ovirt.org/7319
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6cf88c61b054b0e791c7e2c2e4313908dd7a2fc5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Oved Ourfali <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to