cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [3/4] git commit: updated refs/heads/rbac to 5854c0b
Date Wed, 12 Feb 2014 06:46:45 GMT
Fix an AclEntityType cast bug.

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/97ec3f66
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/97ec3f66
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/97ec3f66

Branch: refs/heads/rbac
Commit: 97ec3f6628bfcbe1ad89847005a6c03ce31e6c53
Parents: 7bab0bc
Author: Min Chen <min.chen@citrix.com>
Authored: Tue Feb 11 22:26:52 2014 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Tue Feb 11 22:26:52 2014 -0800

----------------------------------------------------------------------
 .../org/apache/cloudstack/acl/api/AclApiServiceImpl.java  | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97ec3f66/services/iam/plugin/src/org/apache/cloudstack/acl/api/AclApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/services/iam/plugin/src/org/apache/cloudstack/acl/api/AclApiServiceImpl.java
b/services/iam/plugin/src/org/apache/cloudstack/acl/api/AclApiServiceImpl.java
index b6f1caa..29aa258 100644
--- a/services/iam/plugin/src/org/apache/cloudstack/acl/api/AclApiServiceImpl.java
+++ b/services/iam/plugin/src/org/apache/cloudstack/acl/api/AclApiServiceImpl.java
@@ -255,16 +255,16 @@ public class AclApiServiceImpl extends ManagerBase implements AclApiService,
Man
 
     private void addDomainWideResourceAccess(Map<String, Object> params) {
 
-        String entityType = (String) params.get(ApiConstants.ENTITY_TYPE);
+        AclEntityType entityType = (AclEntityType)params.get(ApiConstants.ENTITY_TYPE);
         Long entityId = (Long) params.get(ApiConstants.ENTITY_ID);
         Long domainId = (Long) params.get(ApiConstants.DOMAIN_ID);
         Boolean isRecursive = (Boolean) params.get(ApiConstants.SUBDOMAIN_ACCESS);
 
-        if (AclEntityType.Network.toString().equals(entityType)) {
-            createPolicyAndAddToDomainGroup("DomainWideNetwork-" + entityId, "domain wide
network", entityType,
+        if (entityType == AclEntityType.Network) {
+            createPolicyAndAddToDomainGroup("DomainWideNetwork-" + entityId, "domain wide
network", entityType.toString(),
                     entityId, "listNetworks", AccessType.UseEntry, domainId, isRecursive);
-        } else if (AclEntityType.AffinityGroup.toString().equals(entityType)) {
-            createPolicyAndAddToDomainGroup("DomainWideNetwork-" + entityId, "domain wide
affinityGroup", entityType,
+        } else if (entityType == AclEntityType.AffinityGroup) {
+            createPolicyAndAddToDomainGroup("DomainWideNetwork-" + entityId, "domain wide
affinityGroup", entityType.toString(),
                     entityId, "listAffinityGroups", AccessType.UseEntry, domainId, isRecursive);
         }
 


Mime
View raw message