From d04a42022b2338d529d245080fa506f72cdc8daa Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 26 Sep 2016 13:27:48 +0200 Subject: [PATCH] [REF] website, *: review website access rights * event, website_event, website_forum, * website_hr_recruitment, website_sale Website access rights were buggy. The editor assets and website editor assets have to be loaded together to work so the previous behavior which only loaded one with the restricted access right was not right. Also, people which had the "Manager" access right for model like event or job only got access to creation and edition of those objects if they had the full access to website access rights. Now the website module creates the two same groups : * group_website_publisher: load all editor assets, give access to page creation for model the user has access (event, job, ...) and edition of those pages * group_website_designer: implies the first one and give access in creation and edition of all pages + access of all website menus The manager access rights for event, product, jobs, etc now implies the group_website_publisher group for the user (so that the manager have the editor assets and editor ui). Note: some python codes use the group_website_publisher for no right reason, this has to be adapted. --- addons/event/security/event_security.xml | 3 -- addons/web_editor/static/src/js/editor.js | 2 +- addons/website/__manifest__.py | 2 +- addons/website/data/website_data.xml | 17 ----------- addons/website/security/website_security.xml | 15 ++++++++++ .../views/website_navbar_templates.xml | 28 +++++++++---------- addons/website/views/website_templates.xml | 9 +++--- .../security/website_event_security.xml | 4 +++ .../views/website_event_templates.xml | 6 ++-- addons/website_forum/views/website_forum.xml | 8 +++--- .../website_hr_recruitment_security.xml | 6 +++- .../website_hr_recruitment_templates.xml | 4 +-- .../views/website_mail_channel_templates.xml | 15 +++++----- .../views/website_mass_mailing_templates.xml | 14 ++++++---- .../views/website_partner_templates.xml | 4 +-- addons/website_sale/security/website_sale.xml | 6 ++-- addons/website_sale/views/templates.xml | 8 ++---- 17 files changed, 76 insertions(+), 75 deletions(-) diff --git a/addons/event/security/event_security.xml b/addons/event/security/event_security.xml index e529880a456..6605989b3fc 100644 --- a/addons/event/security/event_security.xml +++ b/addons/event/security/event_security.xml @@ -1,7 +1,6 @@ - User @@ -14,8 +13,6 @@ - - diff --git a/addons/web_editor/static/src/js/editor.js b/addons/web_editor/static/src/js/editor.js index 1163635146f..240a0a36121 100644 --- a/addons/web_editor/static/src/js/editor.js +++ b/addons/web_editor/static/src/js/editor.js @@ -16,7 +16,7 @@ var editor = {}; editor.dummy = function () {return true;}; // used for snippets, options... -editor.editable = !!$('html').data('editable'); +editor.editable = !!($('html').data('editable') || $("[data-oe-model]").length); // temporary hack, this should be done in python ajax.loadXML('/web_editor/static/src/xml/editor.xml', qweb); diff --git a/addons/website/__manifest__.py b/addons/website/__manifest__.py index 293370b1a95..aaba5cea675 100644 --- a/addons/website/__manifest__.py +++ b/addons/website/__manifest__.py @@ -18,8 +18,8 @@ Odoo Website CMS 'data': [ 'data/website_data.xml', 'data/web_planner_data.xml', - 'security/ir.model.access.csv', 'security/website_security.xml', + 'security/ir.model.access.csv', 'views/website_templates.xml', 'views/website_navbar_templates.xml', diff --git a/addons/website/data/website_data.xml b/addons/website/data/website_data.xml index 722a1d17ca9..eaa8a006687 100644 --- a/addons/website/data/website_data.xml +++ b/addons/website/data/website_data.xml @@ -30,23 +30,6 @@ - - Editor - - - - - - Editor and Designer - - - - - - - - - Website Apps ir.module.module diff --git a/addons/website/security/website_security.xml b/addons/website/security/website_security.xml index 893310ae475..2e7ad4cbe6f 100644 --- a/addons/website/security/website_security.xml +++ b/addons/website/security/website_security.xml @@ -1,5 +1,20 @@ + + Restricted Editor + + + + Editor and Designer + + + + + + + + + website_designer: Manage Website and qWeb view diff --git a/addons/website/views/website_navbar_templates.xml b/addons/website/views/website_navbar_templates.xml index 8ae2538ceba..43994030561 100644 --- a/addons/website/views/website_navbar_templates.xml +++ b/addons/website/views/website_navbar_templates.xml @@ -30,21 +30,21 @@
Website
-
    +
      - - -