Updated Branches: refs/heads/rbac c3baf3ad7 -> 9d0d96225
more of account_type refactoring Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9d0d9622 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9d0d9622 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9d0d9622 Branch: refs/heads/rbac Commit: 9d0d96225dc77f1a54108de48ed12bdaa07a7ec4 Parents: c3baf3a Author: Prachi Damle <[email protected]> Authored: Thu Nov 21 16:00:49 2013 -0800 Committer: Prachi Damle <[email protected]> Committed: Thu Nov 21 16:03:19 2013 -0800 ---------------------------------------------------------------------- server/src/com/cloud/server/ManagementServerImpl.java | 2 +- server/src/com/cloud/servlet/ConsoleProxyServlet.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9d0d9622/server/src/com/cloud/server/ManagementServerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 6dfcdf9..2c960ff 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -923,7 +923,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe boolean result =true; List<Long> permittedAccountIds = new ArrayList<Long>(); - if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL || caller.getType() == Account.ACCOUNT_TYPE_PROJECT) { + if (_accountMgr.isNormalUser(caller.getId()) || caller.getType() == Account.ACCOUNT_TYPE_PROJECT) { permittedAccountIds.add(caller.getId()); } else { DomainVO domain = _domainDao.findById(caller.getDomainId()); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9d0d9622/server/src/com/cloud/servlet/ConsoleProxyServlet.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/servlet/ConsoleProxyServlet.java b/server/src/com/cloud/servlet/ConsoleProxyServlet.java index 463f4a5..4756830 100644 --- a/server/src/com/cloud/servlet/ConsoleProxyServlet.java +++ b/server/src/com/cloud/servlet/ConsoleProxyServlet.java @@ -475,7 +475,7 @@ public class ConsoleProxyServlet extends HttpServlet { try { _accountMgr.checkAccess(accountObj, null, true, vm); } catch (PermissionDeniedException ex) { - if (accountObj.getType() == Account.ACCOUNT_TYPE_NORMAL) { + if (_accountMgr.isNormalUser(accountObj.getId())) { if (s_logger.isDebugEnabled()) { s_logger.debug("VM access is denied. VM owner account " + vm.getAccountId() + " does not match the account id in session " + accountObj.getId() + " and caller is a normal user");
