You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2026/09/29 16:27:05 UTC

(ofbiz-framework) branch trunk updated: Fixed: viewContentPermission() never propagates roleEntity/roleEntityField (OFBIZ-13626)

This is an automated email from the ASF dual-hosted git repository.

mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 4b93cb6c7c Fixed: viewContentPermission() never propagates roleEntity/roleEntityField (OFBIZ-13626)
4b93cb6c7c is described below

commit 4b93cb6c7cf42cd5c08265d4e95148f5a06e6917
Author: Mridul Pathak <mr...@gmail.com>
AuthorDate: Tue Sep 29 20:31:34 2026 +0530

    Fixed: viewContentPermission() never propagates roleEntity/roleEntityField (OFBIZ-13626)
    
    checkContentOperationSecurity() reads roleEntity/roleEntityField from the parameters map instead of its own arguments. createContentPermission() and updateContentPermission() both set those parameters keys before calling in; viewContentPermission() never did, and the field isn't declared on genericContentPermission's servicedef, so it was genuinely absent. Result: VIEW was denied for any user with CONTENTMGR_ROLE but not full CONTENTMGR, on essentially all content, via the _NA_ fallba [...]
---
 .../apache/ofbiz/content/permission/ContentPermissionServices.groovy   | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/applications/content/src/main/groovy/org/apache/ofbiz/content/permission/ContentPermissionServices.groovy b/applications/content/src/main/groovy/org/apache/ofbiz/content/permission/ContentPermissionServices.groovy
index 3eb65516e0..ad27f5dca6 100644
--- a/applications/content/src/main/groovy/org/apache/ofbiz/content/permission/ContentPermissionServices.groovy
+++ b/applications/content/src/main/groovy/org/apache/ofbiz/content/permission/ContentPermissionServices.groovy
@@ -107,6 +107,9 @@ Map viewContentPermission(Boolean hasPermission, String contentId, String conten
                           String contentPurposeTypeId, String roleEntity,
                           String roleEntityField) {
 
+    parameters.roleEntity = roleEntity
+    parameters.roleEntityField = roleEntityField
+
     // if called directly check the main permission
     if (!hasPermission) {
         parameters.primaryPermission = 'CONTENTMGR'