[Yanel-commits] rev 59458 - public/yanel/trunk/src/core/java/org/wyona/yanel/cmdl

michi at wyona.com michi at wyona.com
Mon Jul 18 16:32:28 CEST 2011


Author: michi
Date: 2011-07-18 16:32:28 +0200 (Mon, 18 Jul 2011)
New Revision: 59458

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/cmdl/YanelCommandLine.java
Log:
use resource manager in order to get resource instead setting it explicitely

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/cmdl/YanelCommandLine.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/cmdl/YanelCommandLine.java	2011-07-18 14:14:43 UTC (rev 59457)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/cmdl/YanelCommandLine.java	2011-07-18 14:32:28 UTC (rev 59458)
@@ -105,7 +105,8 @@
     
 
         String[] groupnames = {"admin", "accounting"};
-        if (pm.authorize(path, new Identity("lenya", groupnames, "lenya"), new Role("view"))) {
+        Identity identity = new Identity("lenya", groupnames, "lenya");
+        if (pm.authorize(path, identity, new Role("view"))) {
             System.out.println("Access granted: " + path + " (Realm ID: " + realm.getID() + ")");
         } else {
             // TODO: Deny access resp. start login process!
@@ -137,13 +138,14 @@
         CommandLineRequest request = new CommandLineRequest(url);
         CommandLineResponse response = new CommandLineResponse();
         try {
+            // TODO: res  = yanel.getResourceManager().getResource(new org.wyona.yanel.core.Environment(request, response, identity, org.wyona.yanel.core.StateOfView.LIVE, null), realm, path);
             res = rtr.newResource(rti);
             res.setYanel(yanel);
             res.setRequest(request);
             res.setResponse(response);
             System.out.println("Resource path: " + res.getPath());
         } catch(Exception e) {
-            System.err.println("Exception (also see log4j): " + e);
+            System.err.println("Exception (also see log4j: tail -f logs/log4j-cmdl.log): " + e);
             log.error(e.getMessage(), e);
             return;
         }



More information about the Yanel-commits mailing list