Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035263Openbravo ERP01. General setuppublic2017-02-14 16:412017-03-15 20:19
ngarcia 
vmromanos 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q2 
markmm82
Core
No
0035263: Role can add a widget to the workspace and see its contents although it does not have access to it
Role can add a widget to the workspace and see its contents although it does not have access to it
As group admin role:
   Create a new role
   Set it as Manual
   Add F&B España Organization
   Create a new user
   Add the previously created role
   Log out
   Log in with the previously created role
   Click on Add Widget option in the workspace
   Select Best Sellers
   Insert a number in the Number of Rows field and Save
   Check you see the records and you should not
   
No tags attached.
related to defect 0035352 new Triage Omni OMS [Documentation] Add an explanation about Enable for all users option at widget level in Role - Widget Class Access 
Issue History
2017-02-14 16:41ngarciaNew Issue
2017-02-14 16:41ngarciaAssigned To => Triage Finance
2017-02-14 16:41ngarciaModules => Core
2017-02-14 16:41ngarciaResolution time => 1489705200
2017-02-14 16:41ngarciaTriggers an Emergency Pack => No
2017-02-14 16:42ngarciaIssue Monitored: networkb
2017-02-14 16:48jfrancesIssue Monitored: jfrances
2017-02-14 22:39markmm82Assigned ToTriage Finance => collazoandy4
2017-02-16 11:25vmromanosStatusnew => scheduled
2017-02-16 11:25vmromanosAssigned Tocollazoandy4 => vmromanos
2017-02-16 12:22vmromanosNote Added: 0094384
2017-02-16 12:24vmromanosNote Added: 0094385
2017-02-16 12:31jfrancesNote Added: 0094386
2017-02-16 13:21vmromanosNote Edited: 0094385bug_revision_view_page.php?bugnote_id=0094385#r14615
2017-02-16 17:25markmm82Note Added: 0094397
2017-02-16 17:30markmm82Note Edited: 0094397bug_revision_view_page.php?bugnote_id=0094397#r14623
2017-02-16 17:32jfrancesNote Added: 0094399
2017-02-16 18:42vmromanosNote Added: 0094404
2017-02-16 19:13hgbotCheckin
2017-02-16 19:13hgbotNote Added: 0094405
2017-02-16 19:13hgbotStatusscheduled => resolved
2017-02-16 19:13hgbotResolutionopen => fixed
2017-02-16 19:13hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a28822293fdd507896a5d172e32dd4712d62277a [^]
2017-02-16 19:15markmm82Review Assigned To => markmm82
2017-02-16 19:15markmm82Note Added: 0094406
2017-02-16 19:15markmm82Statusresolved => closed
2017-02-16 19:15markmm82Fixed in Version => 3.0PR17Q2
2017-02-23 18:34ngarciaRelationship addedrelated to 0035352
2017-03-15 20:19hudsonbotCheckin
2017-03-15 20:19hudsonbotNote Added: 0095190

Notes
(0094384)
vmromanos   
2017-02-16 12:22   
Note that this issue only affects Best Seller widget, so it's not a generic platform issue
(0094385)
vmromanos   
2017-02-16 12:24   
(edited on: 2017-02-16 13:21)
Test plan:

As group admin role:
   Create a new role
   Set it as Manual
   Add F&B España Organization
   Create a new user
   Add the previously created role
   Log out
   Log in with the previously created user
   Click on Add Widget option in the workspace
   Select Best Sellers
   Insert a number in the Number of Rows field and Save
   Verify you only see records that belong to Spanish organizations (easily to identify as they are written in Spanish)

(0094386)
jfrances   
2017-02-16 12:31   
For the above test plan indicated by vromanos, the new user/role shouldn't have access to the widget if the widget is not in the rol.
The user can see information in the widgets without having permisionss to view this information. The user don't have access to the product window neither "best seller" widget, but the can add the widget to its workspace.
(0094397)
markmm82   
2017-02-16 17:25   
(edited on: 2017-02-16 17:30)
In the particular case of access to widgets, unlike how the rest of the windows and processes works in OB,
There is the "Enable for all Users" flag which, when activated, makes access to this widget public.

This configuration has a higher priority than having defined the access or not of the role to a widget.

For this reason, if it is desired that not all the roles have access to a widget it will be necessary:
-First disable the "Enable for all Users" option for those widgets that will not be publicly accessible.
-Go to the Role window, select the role you want to access. Move to the "Widget Class Access" tab and add the widgets to which you want to allow access to the role.

This way users from the role only will be able to see public widgets (those with the "Enable for all Users" flag checked) and configured to the role with not public access.

From this point of view I think this is not an issue and has a functional solution.

(0094399)
jfrances   
2017-02-16 17:32   
Thanks markmm82, you're right, I didn't know that functionality.
(0094404)
vmromanos   
2017-02-16 18:42   
You are mixing up things:

1. This flag is to enable the widget to a role regardless this role has not explicit access to the widget in the Widget Access tab.

2. Once the widget is enable for the user, it can only shows records belonging to the organizations where it has access to. In the test plan, it has no sense that the user can see records belonging to US because he has no access to this organization.
That's why this is a real issue that should be fixed.

3. Finally the widget can show information about entities that you don't have access to. Actually it doesn't show the full entity, but just "names and numbers". If you try to browse to the window for that entity, the system will block you if your role doesn't have the necessary privileges to the window.
(0094405)
hgbot   
2017-02-16 19:13   
Repository: erp/devel/pi
Changeset: a28822293fdd507896a5d172e32dd4712d62277a
Author: Victor Martinez Romanos <victor.martinez <at> openbravo.com>
Date: Thu Feb 16 12:22:58 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a28822293fdd507896a5d172e32dd4712d62277a [^]

Fixed bug 35263: Organization filter in Best Seller widget

The Best Seller widget didn't have organization filter thus showing records belonging to organizations where the role doesn't have access to.

The fix introduces a new parameter to get the readable orgs, and the HQL query has been adapated to use it.

---
M modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBCQL_WIDGET_QUERY.xml
M modules/org.openbravo.client.widgets/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml
---
(0094406)
markmm82   
2017-02-16 19:15   
Code review + Testing OK
(0095190)
hudsonbot   
2017-03-15 20:19   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/54e102bef53e [^]
Maturity status: Test