fixed bug 32354: field edit access doesn't allow to save if tab contains audit
authorAsier Lostalé <asier.lostale@openbravo.com>
Fri, 26 Feb 2016 08:57:54 +0100
changeset 28684 fd863146a4f4
parent 28683 f2e7ebc3ea7f
child 28685 975b020c2587
child 28972 a60cb9d19270
fixed bug 32354: field edit access doesn't allow to save if tab contains audit

For tabs that explicitly define their audit (updated/updated by) fields, roles
with access to edit only some fields couldn't save unless in those fields audit
were also included.

Now audit fields are not checked for this validation as they are always updated
on any allowed modification.
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Fri Feb 26 08:20:01 2016 +0100
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Fri Feb 26 08:57:54 2016 +0100
@@ -254,6 +254,9 @@
       fieldQuery.setNamedParameter("roleId", roleId);
       for (Field f : fieldQuery.list()) {
         Property property = KernelUtils.getProperty(f);
+        if (property.isAuditInfo()) {
+          continue;
+        }
         String key = property.getName();
         if (data.has(key)) {
           String newValue = getValue(data, key);