Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CEDEB10E30 for ; Fri, 5 Jul 2013 11:04:00 +0000 (UTC) Received: (qmail 86794 invoked by uid 500); 5 Jul 2013 11:04:00 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 86592 invoked by uid 500); 5 Jul 2013 11:04:00 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 86575 invoked by uid 99); 5 Jul 2013 11:03:59 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Jul 2013 11:03:59 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id DA0C282C367; Fri, 5 Jul 2013 11:03:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: likithas@apache.org To: commits@cloudstack.apache.org Date: Fri, 05 Jul 2013 11:03:58 -0000 Message-Id: <23f03ae173d647eeb628d325a06a6fab@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: updated refs/heads/master to 06c8e5b Updated Branches: refs/heads/master c56a75da9 -> 06c8e5bfd CLOUDSTACK-3361. [Projects] Allow a normal user to edit public templates created by him. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9c5da1c6 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9c5da1c6 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9c5da1c6 Branch: refs/heads/master Commit: 9c5da1c6e393b6ffc67f2bcf594c1f1cbc71b2b0 Parents: 4bf6c1e Author: Likitha Shetty Authored: Fri Jul 5 16:15:29 2013 +0530 Committer: Likitha Shetty Committed: Fri Jul 5 16:21:47 2013 +0530 ---------------------------------------------------------------------- server/src/com/cloud/acl/DomainChecker.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9c5da1c6/server/src/com/cloud/acl/DomainChecker.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/acl/DomainChecker.java b/server/src/com/cloud/acl/DomainChecker.java index 8b20f3d..94cdfd1 100755 --- a/server/src/com/cloud/acl/DomainChecker.java +++ b/server/src/com/cloud/acl/DomainChecker.java @@ -110,7 +110,10 @@ public class DomainChecker extends AdapterBase implements SecurityChecker { // Domain admin and regular user can delete/modify only templates created by them if (accessType != null && accessType == AccessType.ModifyEntry) { if (!BaseCmd.isRootAdmin(caller.getType()) && owner.getId() != caller.getId()) { - throw new PermissionDeniedException("Domain Admin and regular users can modify only their own Public templates"); + // For projects check if the caller account can access the project account + if (owner.getType() != Account.ACCOUNT_TYPE_PROJECT || !(_projectMgr.canAccessProjectAccount(caller, owner.getId()))) { + throw new PermissionDeniedException("Domain Admin and regular users can modify only their own Public templates"); + } } } }