From ded2785bb1ca06b0f89c26d994f515e8eb8ed18b Mon Sep 17 00:00:00 2001 From: Min Chen Date: Mon, 7 Oct 2013 11:46:40 -0700 Subject: [PATCH] Add interface method to remove account group association from acl_group_account_map. --- .../cloudstack/acl/dao/AclGroupAccountMapDao.java | 2 ++ .../acl/dao/AclGroupAccountMapDaoImpl.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+) 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 76d417be734..344a8609569 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 ListByAccountId; private SearchBuilder _findByAccountAndGroupId; + public static final Logger s_logger = Logger.getLogger(AclGroupAccountMapDaoImpl.class.getName()); + @Override public boolean configure(String name, Map params) throws ConfigurationException { super.configure(name, params); @@ -87,4 +90,15 @@ public class AclGroupAccountMapDaoImpl extends GenericDaoBase sc = ListByAccountId.create(); + sc.setParameters("accountId", accountId); + + int rowsRemoved = remove(sc); + if (rowsRemoved > 0) { + s_logger.debug("Removed account id=" + accountId + " from " + rowsRemoved + " groups"); + } + } + }