Return-Path: Delivered-To: apmail-incubator-esme-commits-archive@minotaur.apache.org Received: (qmail 16445 invoked from network); 20 Jun 2009 14:03:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jun 2009 14:03:55 -0000 Received: (qmail 33209 invoked by uid 500); 20 Jun 2009 14:04:06 -0000 Delivered-To: apmail-incubator-esme-commits-archive@incubator.apache.org Received: (qmail 33182 invoked by uid 500); 20 Jun 2009 14:04:06 -0000 Mailing-List: contact esme-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: esme-dev@incubator.apache.org Delivered-To: mailing list esme-commits@incubator.apache.org Received: (qmail 33172 invoked by uid 99); 20 Jun 2009 14:04:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jun 2009 14:04:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jun 2009 14:03:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2FD822388865; Sat, 20 Jun 2009 14:03:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r786829 - in /incubator/esme/trunk/server/src/main/scala/org/apache/esme: api/RestAPI.scala lib/AccessPoolMgr.scala Date: Sat, 20 Jun 2009 14:03:37 -0000 To: esme-commits@incubator.apache.org From: vdichev@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090620140337.2FD822388865@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vdichev Date: Sat Jun 20 14:03:36 2009 New Revision: 786829 URL: http://svn.apache.org/viewvc?rev=786829&view=rev Log: When a new pool is created, notify the UserActor that the creating user has access to the pool. Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala?rev=786829&r1=786828&r2=786829&view=diff ============================================================================== --- incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala (original) +++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/api/RestAPI.scala Sat Jun 20 14:03:36 2009 @@ -357,7 +357,10 @@ pool <- AccessPool.create.realm("Native").setName(poolName); privilegeSaved = Privilege.create.pool(pool.saveMe).user(user). permission(Permission.Admin).save - ) yield privilegeSaved + ) yield { + if (privilegeSaved) Distributor ! Distributor.AllowUserInPool(user.id.is, pool.id.is) + privilegeSaved + } r } Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala?rev=786829&r1=786828&r2=786829&view=diff ============================================================================== --- incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala (original) +++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/lib/AccessPoolMgr.scala Sat Jun 20 14:03:36 2009 @@ -72,9 +72,10 @@ case Failure(_,_,_) => S.error("Duplicate pool name!") case Full(p: AccessPool) => val privilegeSaved = Privilege.create.pool(p.saveMe).user(user).permission(Permission.Admin).save - if(privilegeSaved) + if(privilegeSaved) { + Distributor ! Distributor.AllowUserInPool(user.get.id.is, p.id.is) S.notice("New pool added") - else + } else S.error("Could not add pool!") case _ => S.error("Could not add pool!") }