related to 36359: don't invalidate cache on changed preferences
authorAsier Lostalé <asier.lostale@openbravo.com>
Fri, 04 Aug 2017 12:20:17 +0200
changeset 32536 e6b6a636d1e4
parent 32535 b74ed74f842a
child 32537 48d6a58b1b9d
related to 36359: don't invalidate cache on changed preferences
src/org/openbravo/service/UserCtxCacheObserver.java
--- a/src/org/openbravo/service/UserCtxCacheObserver.java	Fri Aug 04 10:11:28 2017 +0200
+++ b/src/org/openbravo/service/UserCtxCacheObserver.java	Fri Aug 04 12:20:17 2017 +0200
@@ -29,6 +29,7 @@
 import org.openbravo.model.ad.access.Role;
 import org.openbravo.model.ad.access.User;
 import org.openbravo.model.ad.access.UserRoles;
+import org.openbravo.model.ad.domain.Preference;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.service.web.UserContextCache;
 
@@ -61,6 +62,8 @@
   @Override
   protected boolean isValidEvent(EntityPersistenceEvent event) {
     boolean valid = super.isValidEvent(event);
-    return valid || event.getTargetInstance() instanceof InheritedAccessEnabled;
+    return valid
+        || (event.getTargetInstance() instanceof InheritedAccessEnabled && !(event
+            .getTargetInstance() instanceof Preference));
   }
 }