[roleInheritance] InheritedAccessEnabled, do not rely only on property name
authorCarlos Aristu <carlos.aristu@openbravo.com>
Thu, 01 Oct 2015 14:02:47 +0200
changeset 27787 f41e84580746
parent 27786 644cc4e982e2
child 27788 026fba00f6f7
[roleInheritance] InheritedAccessEnabled, do not rely only on property name
When defining an InheritedAccessEnabled check also it is a FK to role
src/org/openbravo/base/model/Property.java
--- a/src/org/openbravo/base/model/Property.java	Thu Oct 01 11:17:54 2015 +0200
+++ b/src/org/openbravo/base/model/Property.java	Thu Oct 01 14:02:47 2015 +0200
@@ -285,7 +285,9 @@
       getEntity().setActiveEnabled(true);
       setActiveColumn(true);
     }
-    if (getName().equals("inheritedFrom")) {
+    if (getName().equals("inheritedFrom") && !isPrimitive()
+        && "ADRole".equals(getReferencedProperty().getEntity().getName())) {
+      log.info("Entity inheriting from role: " + getEntity().getName());
       getEntity().setHasInheritedFrom(true);
     }
   }