ofri masad has uploaded a new change for review.

Change subject: core: Fix unpermitted Move-Disk in Audit mode
......................................................................

core: Fix unpermitted Move-Disk in Audit mode

When Data Center is in quota enforcement mode 'Audit', a user can move
the disk to a SD which he does not have permission for.

This was caused by wrong permission subjects list creation which
neglected the 'Audit' mode.

Fixed the permission subjects list creation to include 'Audit' mode as
well as 'Disabled' mode (in 'Enforcing' mode this operation will be
blocked by the quota QuotaManager)

Change-Id: Ie50e7dd91611c2b959cea3a78c2684451836760b
Signed-off-by: Ofri Masad <oma...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/10/13410/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
index 4d51086..d7bda4f 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
@@ -1776,7 +1776,8 @@
         if (storagePoolId != null) {
             storagePool = getStoragePoolDAO().get(storagePoolId);
             if (storagePool != null) {
-                if (storagePool.getQuotaEnforcementType() == 
QuotaEnforcementTypeEnum.DISABLED) {
+                if (storagePool.getQuotaEnforcementType() == 
QuotaEnforcementTypeEnum.DISABLED
+                        || storagePool.getQuotaEnforcementType() == 
QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT) {
                     permsList.add(new PermissionSubject(StorageDomainId, 
VdcObjectType.Storage, ActionGroup.CREATE_DISK));
                 }
             }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie50e7dd91611c2b959cea3a78c2684451836760b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to