esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
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 GMT
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!")
           }



Mime
View raw message