details:   https://code.openbravo.com/erp/devel/pi/rev/9db5d62f97ac
changeset: 29428:9db5d62f97ac
user:      Inigo Sanchez <inigo.sanchez <at> openbravo.com>
date:      Thu May 05 09:40:37 2016 +0200
summary:   Fixed issue 32833: Tree view is not working properly

When a node in tree view is moved, entity used to check
security access is null. This exception is shown:
OBSecurityException - Entity null is not readable by the user 100
The problem was that getEntity() method can't retrieves an entity.

Now it have been resolved by getting entity from table
id (referencedTableId).

diffstat:

 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java
 |  12 +++++++--
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (22 lines):

diff -r a6cbad47ab80 -r 9db5d62f97ac 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java
--- 
a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java
  Wed May 04 16:40:02 2016 +0200
+++ 
b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java
  Thu May 05 09:40:37 2016 +0200
@@ -139,9 +139,15 @@
 
   @Override
   public void checkEditDatasourceAccess(Map<String, String> parameter) {
-    Entity theEntity = getEntity();
-    if (!hasAccess(theEntity, null, false)) {
-      throw new OBException(OBMessageUtils.messageBD("AccessTableNoView"));
+    final OBContext obContext = OBContext.getOBContext();
+    String tableId = parameter.get("referencedTableId");
+    try {
+      Entity treeEntity = 
ModelProvider.getInstance().getEntityByTableId(tableId);
+      if (treeEntity != null) {
+        obContext.getEntityAccessChecker().checkWritableAccess(treeEntity);
+      }
+    } catch (OBSecurityException e) {
+      handleExceptionUnsecuredDSAccess(e);
     }
   }
 

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to