You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2013/07/11 12:35:44 UTC

svn commit: r1502182 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java

Author: jleroux
Date: Thu Jul 11 10:35:44 2013
New Revision: 1502182

URL: http://svn.apache.org/r1502182
Log:
A patch from Leon for "make genericContentPermission service (called from within DataEvents.serveObjectData) locale enabled" https://issues.apache.org/jira/browse/OFBIZ-5260

Passes "locale" parameter when calling "genericContentPermission" service.

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java?rev=1502182&r1=1502181&r2=1502182&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataEvents.java Thu Jul 11 10:35:44 2013
@@ -61,6 +61,7 @@ public class DataEvents {
         Delegator delegator = (Delegator) request.getAttribute("delegator");
         LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
         HttpSession session = request.getSession();
+        Locale locale = UtilHttp.getLocale(request);
 
         GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
         String userAgent = request.getHeader("User-Agent");
@@ -131,7 +132,7 @@ public class DataEvents {
         // not public check security
         if (!"Y".equalsIgnoreCase(isPublic)) {
             // do security check
-            Map<String, Object> permSvcCtx = UtilMisc.toMap("userLogin", userLogin, "mainAction", "VIEW", "contentId", contentId);
+            Map<String, ? extends Object> permSvcCtx = UtilMisc.toMap("userLogin", userLogin, "locale", locale, "mainAction", "VIEW", "contentId", contentId);
             Map<String, Object> permSvcResp;
             try {
                 permSvcResp = dispatcher.runSync(permissionService, permSvcCtx);
@@ -161,7 +162,6 @@ public class DataEvents {
         String contextRoot = (String) request.getAttribute("_CONTEXT_ROOT_");
         String webSiteId = (String) session.getAttribute("webSiteId");
         String dataName = dataResource.getString("dataResourceName");
-        Locale locale = UtilHttp.getLocale(request);
 
         // get the mime type
         String mimeType = DataResourceWorker.getMimeType(dataResource);