Fixes issue 22856: Views defined at organization level can be deleted
authorAugusto Mauch <augusto.mauch@openbravo.com>
Wed, 23 Jan 2013 17:58:40 +0100
changeset 19407 1cd5ddac3977
parent 19406 de3e9011052b
child 19408 6c1c82b172f4
Fixes issue 22856: Views defined at organization level can be deleted

On the PersonalizationHandler.canEdit method, in order to check if a saved view could be edited the organization of the user was being compared with the RoleOrganization entity of the view, instead of the organization of the RoleOrganization entity.
modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java	Wed Jan 23 14:18:57 2013 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/personalization/PersonalizationHandler.java	Wed Jan 23 17:58:40 2013 +0100
@@ -142,7 +142,7 @@
     if (uiPersonalization.getVisibleAtOrganization() != null) {
       final String orgId = (String) DalUtil.getId(uiPersonalization.getVisibleAtOrganization());
       for (RoleOrganization roleOrg : adminOrgs) {
-        if (DalUtil.getId(roleOrg).equals(orgId)) {
+        if (DalUtil.getId(roleOrg.getOrganization()).equals(orgId)) {
           return true;
         }
       }