cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [1/2] git commit: updated refs/heads/rbac to 283ec27
Date Mon, 07 Oct 2013 18:48:12 GMT
Updated Branches:
  refs/heads/rbac b633950a6 -> 283ec2793


Add interface method to remove account group association from
acl_group_account_map.

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

Branch: refs/heads/rbac
Commit: ded2785bb1ca06b0f89c26d994f515e8eb8ed18b
Parents: b633950
Author: Min Chen <min.chen@citrix.com>
Authored: Mon Oct 7 11:46:40 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Mon Oct 7 11:46:40 2013 -0700

----------------------------------------------------------------------
 .../cloudstack/acl/dao/AclGroupAccountMapDao.java     |  2 ++
 .../cloudstack/acl/dao/AclGroupAccountMapDaoImpl.java | 14 ++++++++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ded2785b/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDao.java b/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDao.java
index 76d417b..344a860 100644
--- a/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDao.java
+++ b/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDao.java
@@ -31,4 +31,6 @@ public interface AclGroupAccountMapDao extends GenericDao<AclGroupAccountMapVO,
     AclGroupAccountMapVO findAccountInAdminGroup(long accountId);
 
     AclGroupAccountMapVO findByGroupAndAccount(long groupId, long acctId);
+
+    void removeAccountFromGroups(long accountId);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ded2785b/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDaoImpl.java
b/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDaoImpl.java
index e389def..989dd6a 100644
--- a/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/acl/dao/AclGroupAccountMapDaoImpl.java
@@ -21,6 +21,7 @@ import java.util.Map;
 
 import javax.naming.ConfigurationException;
 
+import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.acl.AclGroupAccountMapVO;
@@ -35,6 +36,8 @@ public class AclGroupAccountMapDaoImpl extends GenericDaoBase<AclGroupAccountMap
     private SearchBuilder<AclGroupAccountMapVO> ListByAccountId;
     private SearchBuilder<AclGroupAccountMapVO> _findByAccountAndGroupId;
 
+    public static final Logger s_logger = Logger.getLogger(AclGroupAccountMapDaoImpl.class.getName());
+
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{
         super.configure(name, params);
@@ -87,4 +90,15 @@ public class AclGroupAccountMapDaoImpl extends GenericDaoBase<AclGroupAccountMap
         return findOneBy(sc);
     }
 
+    @Override
+    public void removeAccountFromGroups(long accountId) {
+        SearchCriteria<AclGroupAccountMapVO> sc = ListByAccountId.create();
+        sc.setParameters("accountId", accountId);
+
+        int rowsRemoved = remove(sc);
+        if (rowsRemoved > 0) {
+            s_logger.debug("Removed account id=" + accountId + " from " + rowsRemoved + "
groups");
+        }
+    }
+
 }


Mime
View raw message