Author: nmalin
Date: Thu Feb 1 20:54:17 2018
New Revision: 1822908
URL:
http://svn.apache.org/viewvc?rev=1822908&view=revLog:
Improved: Set security object on groovy context (OFBIZ-10196)
In a groovy service to call the security object you need to do : Security security = dispatcher.dispatchContext.security
For simplification, I set the security object in groovy context like dispatcher and delegator to call directly security.hasPermission()
Modified:
ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyEngine.java
Modified: ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyEngine.java
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyEngine.java?rev=1822908&r1=1822907&r2=1822908&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyEngine.java (original)
+++ ofbiz/ofbiz-framework/trunk/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyEngine.java Thu Feb 1 20:54:17 2018
@@ -96,6 +96,7 @@ public final class GroovyEngine extends
DispatchContext dctx = dispatcher.getLocalContext(localName);
gContext.put("dctx", dctx);
+ gContext.put("security", dctx.getSecurity());
gContext.put("dispatcher", dctx.getDispatcher());
gContext.put("delegator", dispatcher.getDelegator());
try {