[ofbiz-framework] branch release18.12 updated: Fixed: Plugin not showing in menu due to permission (OFBIZ-12233)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch release18.12 updated: Fixed: Plugin not showing in menu due to permission (OFBIZ-12233)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/release18.12 by this push:
     new b8f9c02  Fixed: Plugin not showing in menu due to permission  (OFBIZ-12233)
b8f9c02 is described below

commit b8f9c029cedea15d6145a6325e8b203a05bd27cf
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Mon May 17 11:56:00 2021 +0200

    Fixed: Plugin not showing in menu due to permission  (OFBIZ-12233)
   
    When creating a plugin via gradle :
    ./gradlew createPlugin -PpluginId=plugin-test -PpluginResourceName=PluginTest
    -PwebappName=plugin-test -PbasePermission=PLUGIN_TEST
   
    and loading all the required data and permissions, the plugin doesn't appear
    in the menu.
   
    It comes from the ComponentConfig.java file, L1229, when the permissions gets
    trimmed and modified. I tried removing it locally and it fixed the problem.
   
    Thanks: Gaetan Chaboussie
---
 .../main/java/org/apache/ofbiz/base/component/ComponentConfig.java  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java
index 3434e77..c7cb8f6 100644
--- a/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java
+++ b/framework/base/src/main/java/org/apache/ofbiz/base/component/ComponentConfig.java
@@ -39,6 +39,7 @@ import org.apache.ofbiz.base.location.FlexibleLocation;
 import org.apache.ofbiz.base.util.Assert;
 import org.apache.ofbiz.base.util.Debug;
 import org.apache.ofbiz.base.util.KeyStoreUtil;
+import org.apache.ofbiz.base.util.StringUtil;
 import org.apache.ofbiz.base.util.UtilURL;
 import org.apache.ofbiz.base.util.UtilValidate;
 import org.apache.ofbiz.base.util.UtilXml;
@@ -906,10 +907,7 @@ public final class ComponentConfig {
             }
             // trim the permissions (remove spaces)
             for (int i = 0; i < this.basePermission.length; i++) {
-                this.basePermission[i] = this.basePermission[i].trim();
-                if (this.basePermission[i].indexOf('_') != -1) {
-                    this.basePermission[i] = this.basePermission[i].substring(0, this.basePermission[i].indexOf('_'));
-                }
+                this.basePermission[i] = StringUtil.removeSpaces(this.basePermission[i]);
             }
             String menuNameStr = element.getAttribute("menu-name");
             if (UtilValidate.isNotEmpty(menuNameStr)) {