details:   https://code.openbravo.com/erp/devel/pi/rev/e5c99a21da3e
changeset: 19359:e5c99a21da3e
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Mon Jan 21 09:48:39 2013 +0100
summary:   Fixed issue 22644. Now a role can be restricted from accessing the 
backend.
> - A new check has been added to the role table. If this check is set, the 
> role will not have access to the backend.
> - Regardless of the value of this check, a role will be able to access other 
> applications (such as the WebPOS), provided that it has access to the 
> corresponding window.
> - If a user attempts to log in Openbravo, all its roles will be checked. If 
> all the roles are restricted, the user will not be able to login. If the 
> default role is restricted but others are available, the user will log in one 
> of them.
> - If a user is already logged with a restricted user (for example, in the 
> WebPOS), and attempts to open the backend, an error will be shown.

diffstat:

 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
                                                     |  22 ++
 
modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java
 |   2 +-
 referencedata/sampledata/F_B_International_Group.xml                           
                                                        |  94 ++++++---
 referencedata/sampledata/QA_Testing.xml                                        
                                                        |  58 +++--
 src-db/database/model/tables/AD_ROLE.xml                                       
                                                        |   5 +
 src-db/database/sourcedata/AD_COLUMN.xml                                       
                                                        |  35 +++
 src-db/database/sourcedata/AD_ELEMENT.xml                                      
                                                        |  14 +
 src-db/database/sourcedata/AD_FIELD.xml                                        
                                                        |  29 +++
 src-db/database/sourcedata/AD_MESSAGE.xml                                      
                                                        |  22 ++
 src-db/database/sourcedata/AD_REF_LIST.xml                                     
                                                        |  12 +
 src/index.jsp                                                                  
                                                        |  16 +
 src/org/openbravo/base/secureApp/DefaultOptions_data.xsql                      
                                                        |   4 +-
 src/org/openbravo/base/secureApp/LoginHandler.java                             
                                                        |  19 +-
 13 files changed, 266 insertions(+), 66 deletions(-)

diffs (truncated from 1130 to 300 lines):

diff -r d64833c3f0c1 -r e5c99a21da3e 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
--- 
a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
        Mon Jan 21 13:53:11 2013 +0530
+++ 
b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
        Mon Jan 21 09:48:39 2013 +0100
@@ -253,6 +253,17 @@
 <!--2052DF26669F4864B295C17502F53E38-->  
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--2052DF26669F4864B295C17502F53E38--></AD_MESSAGE>
 
+<!--20EBBDD0DE864992AD7B8090D1126A06--><AD_MESSAGE>
+<!--20EBBDD0DE864992AD7B8090D1126A06-->  
<AD_MESSAGE_ID><![CDATA[20EBBDD0DE864992AD7B8090D1126A06]]></AD_MESSAGE_ID>
+<!--20EBBDD0DE864992AD7B8090D1126A06-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--20EBBDD0DE864992AD7B8090D1126A06-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--20EBBDD0DE864992AD7B8090D1126A06-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--20EBBDD0DE864992AD7B8090D1126A06-->  
<VALUE><![CDATA[OBUIAPP_RestrictedUser]]></VALUE>
+<!--20EBBDD0DE864992AD7B8090D1126A06-->  <MSGTEXT><![CDATA[This user doesn't 
have access to the backend. To be able to access Openbravo, a user needs a role 
with access to the backend.]]></MSGTEXT>
+<!--20EBBDD0DE864992AD7B8090D1126A06-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--20EBBDD0DE864992AD7B8090D1126A06-->  
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--20EBBDD0DE864992AD7B8090D1126A06--></AD_MESSAGE>
+
 <!--2C8A8843F1E04317AD38623A3C52F978--><AD_MESSAGE>
 <!--2C8A8843F1E04317AD38623A3C52F978-->  
<AD_MESSAGE_ID><![CDATA[2C8A8843F1E04317AD38623A3C52F978]]></AD_MESSAGE_ID>
 <!--2C8A8843F1E04317AD38623A3C52F978-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1072,6 +1083,17 @@
 <!--D514BC49ED374B7288B215D94DAC3177-->  
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--D514BC49ED374B7288B215D94DAC3177--></AD_MESSAGE>
 
+<!--D71BBF4693BD45329F17355A907B9D39--><AD_MESSAGE>
+<!--D71BBF4693BD45329F17355A907B9D39-->  
<AD_MESSAGE_ID><![CDATA[D71BBF4693BD45329F17355A907B9D39]]></AD_MESSAGE_ID>
+<!--D71BBF4693BD45329F17355A907B9D39-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D71BBF4693BD45329F17355A907B9D39-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D71BBF4693BD45329F17355A907B9D39-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D71BBF4693BD45329F17355A907B9D39-->  
<VALUE><![CDATA[OBUIAPP_RestrictedUserTitle]]></VALUE>
+<!--D71BBF4693BD45329F17355A907B9D39-->  <MSGTEXT><![CDATA[Access 
Restricted]]></MSGTEXT>
+<!--D71BBF4693BD45329F17355A907B9D39-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--D71BBF4693BD45329F17355A907B9D39-->  
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--D71BBF4693BD45329F17355A907B9D39--></AD_MESSAGE>
+
 <!--DAC8C406FB1D497CAF91619E6B8A5458--><AD_MESSAGE>
 <!--DAC8C406FB1D497CAF91619E6B8A5458-->  
<AD_MESSAGE_ID><![CDATA[DAC8C406FB1D497CAF91619E6B8A5458]]></AD_MESSAGE_ID>
 <!--DAC8C406FB1D497CAF91619E6B8A5458-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r d64833c3f0c1 -r e5c99a21da3e 
modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java
    Mon Jan 21 13:53:11 2013 +0530
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java
    Mon Jan 21 09:48:39 2013 +0100
@@ -308,7 +308,7 @@
     // "        AND A_U_R.AD_USER_ID = ?" +
     // "        ORDER BY A_R.NAME";
     final OBQuery<UserRoles> rolesQuery = 
OBDal.getInstance().createQuery(UserRoles.class,
-        " userContact.id=? and role.active=true");
+        " userContact.id=? and role.active=true and 
role.isrestrictbackend=false");
     rolesQuery.setFilterOnReadableClients(false);
     rolesQuery.setFilterOnReadableOrganization(false);
     rolesQuery.setParameters(Collections.singletonList((Object) 
OBContext.getOBContext().getUser()
diff -r d64833c3f0c1 -r e5c99a21da3e 
referencedata/sampledata/F_B_International_Group.xml
--- a/referencedata/sampledata/F_B_International_Group.xml      Mon Jan 21 
13:53:11 2013 +0530
+++ b/referencedata/sampledata/F_B_International_Group.xml      Mon Jan 21 
09:48:39 2013 +0100
@@ -38392,7 +38392,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-04T00:00:00.0Z</expectedDate>
-    <daysOverdue>45</daysOverdue>
+    <daysOverdue>48</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -39064,7 +39064,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2013-01-03T00:00:00.0Z</expectedDate>
-    <daysOverdue>15</daysOverdue>
+    <daysOverdue>18</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -39424,7 +39424,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-03T00:00:00.0Z</expectedDate>
-    <daysOverdue>46</daysOverdue>
+    <daysOverdue>49</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -40072,7 +40072,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-19T00:00:00.0Z</expectedDate>
-    <daysOverdue>30</daysOverdue>
+    <daysOverdue>33</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -40216,7 +40216,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-11T00:00:00.0Z</expectedDate>
-    <daysOverdue>38</daysOverdue>
+    <daysOverdue>41</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -40936,7 +40936,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-11-15T00:00:00.0Z</expectedDate>
-    <daysOverdue>64</daysOverdue>
+    <daysOverdue>67</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -41152,7 +41152,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2013-01-03T00:00:00.0Z</expectedDate>
-    <daysOverdue>15</daysOverdue>
+    <daysOverdue>18</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -42352,7 +42352,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-19T00:00:00.0Z</expectedDate>
-    <daysOverdue>30</daysOverdue>
+    <daysOverdue>33</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -42400,7 +42400,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-05T00:00:00.0Z</expectedDate>
-    <daysOverdue>44</daysOverdue>
+    <daysOverdue>47</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -42424,7 +42424,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-10-13T00:00:00.0Z</expectedDate>
-    <daysOverdue>97</daysOverdue>
+    <daysOverdue>100</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -42952,7 +42952,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-21T00:00:00.0Z</expectedDate>
-    <daysOverdue>28</daysOverdue>
+    <daysOverdue>31</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -44224,7 +44224,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2013-01-03T00:00:00.0Z</expectedDate>
-    <daysOverdue>15</daysOverdue>
+    <daysOverdue>18</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -44248,7 +44248,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2013-01-03T00:00:00.0Z</expectedDate>
-    <daysOverdue>15</daysOverdue>
+    <daysOverdue>18</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -44272,7 +44272,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-31T00:00:00.0Z</expectedDate>
-    <daysOverdue>18</daysOverdue>
+    <daysOverdue>21</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -44728,7 +44728,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-31T00:00:00.0Z</expectedDate>
-    <daysOverdue>18</daysOverdue>
+    <daysOverdue>21</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -44752,7 +44752,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2013-01-03T00:00:00.0Z</expectedDate>
-    <daysOverdue>15</daysOverdue>
+    <daysOverdue>18</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -45256,7 +45256,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-12T00:00:00.0Z</expectedDate>
-    <daysOverdue>37</daysOverdue>
+    <daysOverdue>40</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -46000,7 +46000,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-13T00:00:00.0Z</expectedDate>
-    <daysOverdue>36</daysOverdue>
+    <daysOverdue>39</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -46456,7 +46456,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-04T00:00:00.0Z</expectedDate>
-    <daysOverdue>45</daysOverdue>
+    <daysOverdue>48</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -46744,7 +46744,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-05T00:00:00.0Z</expectedDate>
-    <daysOverdue>44</daysOverdue>
+    <daysOverdue>47</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -46816,7 +46816,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-11T00:00:00.0Z</expectedDate>
-    <daysOverdue>38</daysOverdue>
+    <daysOverdue>41</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -46960,7 +46960,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-10-17T00:00:00.0Z</expectedDate>
-    <daysOverdue>93</daysOverdue>
+    <daysOverdue>96</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -47104,7 +47104,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-20T00:00:00.0Z</expectedDate>
-    <daysOverdue>29</daysOverdue>
+    <daysOverdue>32</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -47176,7 +47176,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-11-03T00:00:00.0Z</expectedDate>
-    <daysOverdue>76</daysOverdue>
+    <daysOverdue>79</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -47272,7 +47272,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-11-13T00:00:00.0Z</expectedDate>
-    <daysOverdue>66</daysOverdue>
+    <daysOverdue>69</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -47944,7 +47944,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2013-01-02T00:00:00.0Z</expectedDate>
-    <daysOverdue>16</daysOverdue>
+    <daysOverdue>19</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -48088,7 +48088,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
     <expectedDate>2012-12-03T00:00:00.0Z</expectedDate>
-    <daysOverdue>46</daysOverdue>
+    <daysOverdue>49</daysOverdue>
     <lastPaymentDate xsi:nil="true"/>
     <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
@@ -48184,7 +48184,7 @@
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to