Hi All,

I suppose, from this snippet taken from the 1st line of Revision: 664118

-security = request.getAttribute("security");
-delegator = request.getAttribute("delegator");
-
-if(security.hasEntityPermission("CATALOG", "_VIEW", session)) {
-    context.hasPermission = Boolean.TRUE;
-} else {
-    context.hasPermission = Boolean.FALSE;
-}
+context.hasPermission = security.hasEntityPermission("CATALOG", "_VIEW", 
session);

that Groovy provides the variables security and delegator without having to get 
them out of request (I was surprised, so I tested, and it works ;o). Is there a 
list somewhere of all alike variables (I searched a bit but it's far too late 
now) ?

BTW, I wonder if you (OFBiz developpers/contributors) would like to share 
idioms you use either in Java, Freemarker and now Groovy. We could create a 
Wiki page for that (under Best practices I guess). This could be interesting 
(mostly for Groovy which is much creative) for 2 reasons : to grow our 
personnal knowledge without having to refer to code (where we know there is 
this stuff we search for, somewhere we saw before) and homogenize our way of 
coding which should be fruitful for everybody (after all, we share the code). 
Sorry for the long sentence :o)

If some of you are interested just let me know and I will create this page and 
a new thread.

Thanks

Jacques

Reply via email to