Updated Branches:
  refs/heads/rbac 579806440 -> b87b9e5c6

Populate acl_group_account_map table in creating an account.

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

Branch: refs/heads/rbac
Commit: 7342c97fa905555502c163115f015e09fd6d44e7
Parents: ddd4f80
Author: Min Chen <[email protected]>
Authored: Mon Oct 7 13:20:49 2013 -0700
Committer: Min Chen <[email protected]>
Committed: Mon Oct 7 13:20:49 2013 -0700

----------------------------------------------------------------------
 server/src/com/cloud/user/AccountManagerImpl.java | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7342c97f/server/src/com/cloud/user/AccountManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/user/AccountManagerImpl.java 
b/server/src/com/cloud/user/AccountManagerImpl.java
index 270ab79..de528f1 100755
--- a/server/src/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/com/cloud/user/AccountManagerImpl.java
@@ -599,6 +599,9 @@ public class AccountManagerImpl extends ManagerBase 
implements AccountManager, M
             //delete the account from project accounts
             _projectAccountDao.removeAccountFromProjects(accountId);
 
+            //delete the account from group
+            _aclGroupAccountDao.removeAccountFromGroups(accountId);
+
             // delete all vm groups belonging to accont
             List<InstanceGroupVO> groups = 
_vmGroupDao.listByAccountId(accountId);
             for (InstanceGroupVO group : groups) {
@@ -943,6 +946,13 @@ public class AccountManagerImpl extends ManagerBase 
implements AccountManager, M
             String registrationToken = 
UUID.nameUUIDFromBytes(bytes).toString();
             user.setRegistrationToken(registrationToken);
         }
+
+        // create correct account and group association based on accountType
+        if (accountType != Account.ACCOUNT_TYPE_PROJECT) {
+            AclGroupAccountMapVO grpAcct = new 
AclGroupAccountMapVO(accountType + 1, accountId);
+            _aclGroupAccountDao.persist(grpAcct);
+        }
+
         txn.commit();
 
         CallContext.current().putContextParameter(Account.class, 
account.getUuid());

Reply via email to