Skip to content

Commit 5bd31e5

Browse files
yankinmaxantoniodavid
authored andcommitted
[IMP] bi_view_editor: Restrict access to BI View Editor Managers
Forward-port changes from 15.0 OCA#801
1 parent 39ae58e commit 5bd31e5

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

bi_view_editor/__manifest__.py

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"deb": ["graphviz"],
1919
},
2020
"data": [
21+
"security/res_groups.xml",
2122
"security/ir.model.access.csv",
2223
"security/rules.xml",
2324
"views/bve_view.xml",

bi_view_editor/readme/USAGE.rst

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
To graphically design your analysis data-set:
22

33
- From the Dashboards menu, select "Custom BI Views"
4+
- BI Views creation is restricted to members of "BI View Editor Manager" group.
5+
You can add this group to a user in User form, Access Rights, Technical section.
46
- Browse trough the business objects in the "Query Builder" tab
57
- Pick the interesting fields (Drag & Drop)
68
- For each selected field, right-click on the Options column and select whether
@@ -13,6 +15,7 @@ To access the created BI View with a dedicated menu:
1315

1416
- If module Dashboard (board) is installed, the standard "Add to My Dashboard"
1517
functionality would be available
18+
- "Create a menu" is restricted to members of "BI View Editor Manager" group.
1619
- Click "Create a menu" to create a new menu item directly linked to your new
1720
BI view (this feature is available in developer mode); when the BI view is
1821
reset back to draft this menu will be removed, and you will need to re-create
+4-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2-
access_bve_view_everyone,bve.view,bi_view_editor.model_bve_view,,1,1,1,1
3-
access_bve_view_line,access_bve_view_line,model_bve_view_line,,1,1,1,1
2+
access_bve_view_everyone_user,bve.view.user,bi_view_editor.model_bve_view,base.group_user,1,0,0,0
3+
access_bve_view_everyone_manager,bve.view.manager,bi_view_editor.model_bve_view,bi_view_editor.group_bve_manager,1,1,1,1
4+
access_bve_view_line_user,access_bve_view_line_user,bi_view_editor.model_bve_view_line,base.group_user,1,0,0,0
5+
access_bve_view_line_manager,access_bve_view_line_manager,bi_view_editor.model_bve_view_line,bi_view_editor.group_bve_manager,1,1,1,1
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<odoo noupdate="1">
3+
4+
<record id="group_bve_manager" model="res.groups">
5+
<field name="name">BI View Editor Manager</field>
6+
<field name="category_id" ref="base.module_category_hidden" />
7+
<field name="implied_ids" eval="[(4, ref('base.group_user'))]" />
8+
<field
9+
name="users"
10+
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
11+
/>
12+
</record>
13+
14+
</odoo>

bi_view_editor/views/bve_view.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,29 @@
5151
type="object"
5252
states="created"
5353
string="Reset to Draft"
54+
groups="bi_view_editor.group_bve_manager"
5455
/>
5556
<button
5657
name="action_create"
5758
type="object"
5859
states="draft"
5960
string="Generate BI View"
6061
class="oe_highlight"
62+
groups="bi_view_editor.group_bve_manager"
6163
/>
6264
<button
6365
name="open_view"
6466
type="object"
6567
states="created"
6668
string="Open BI View"
6769
class="oe_highlight"
70+
groups="bi_view_editor.group_bve_manager"
6871
/>
6972
<button
7073
name="%(base.act_menu_create)d"
7174
type="action"
7275
states="created"
73-
groups="base.group_no_one"
76+
groups="bi_view_editor.group_bve_manager"
7477
icon="fa-align-justify"
7578
string="Create a Menu"
7679
target="new"

0 commit comments

Comments
 (0)