[FIX] *: do not use groups when extending an asset bundle
Using groups when declaring an extension of an asset bundle leads to a different generated asset bundle according to the user's group. This is not something we want because a dynamic asset bundle's content means that it could (and it does) trigger unwanted cache invalidation. website_event, website_blog, website_forum and website_sale add functions to `website.contentMenu`. These functions are bound to server side qweb nodes protected by groups. We can always add the functions; if a user tries to use the routes he should receive a traceback because of lack of access rules website_blog adds a `website_blog.editor` module, but is guarded by the presence of a node in the DOM. We use the same logic to guard the module added by website_sale with the `.js_sale` node. website_gengo is working as expected.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Blog Editor" groups="base.group_website_publisher">
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Blog Editor">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_blog/static/src/js/website_blog.editor.js"></script>
|
||||
<script type="text/javascript" src="/website_blog/static/src/js/website.tour.blog.js"></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Event Editor" groups="event.group_event_manager">
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Event Editor">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_event/static/src/js/website_event.editor.js"></script>
|
||||
<script type="text/javascript" src="/website_event/static/src/js/website.tour.event.js"></script>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<data>
|
||||
|
||||
<!-- Editor custom -->
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Forum Editor Assets" groups="base.group_user">
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Forum Editor Assets">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_forum/static/src/js/website_tour_forum.js"/>
|
||||
<script type="text/javascript" src="/website_forum/static/src/js/website_forum.editor.js"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<template id="gengo_assets_editor" inherit_id="website.assets_editor" name="Editor Head" groups="base.group_website_publisher">
|
||||
<template id="gengo_assets_editor" inherit_id="website.assets_editor" name="Editor Head">
|
||||
<xpath expr='.' position="inside">
|
||||
<link rel="stylesheet" href="/website_gengo/static/src/css/website_gengo.css"></link>
|
||||
<script type="text/javascript" src="/website_gengo/static/src/js/website_gengo.js"></script>
|
||||
|
||||
@@ -25,6 +25,10 @@ contentMenu.TopBar.include({
|
||||
},
|
||||
});
|
||||
|
||||
if(!$('.js_sale').length) {
|
||||
return $.Deferred().reject("DOM doesn't contain '.js_sale'");
|
||||
}
|
||||
|
||||
options.registry.website_sale = options.Class.extend({
|
||||
start: function () {
|
||||
var self = this;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Shop Editor" groups="base.group_sale_manager">
|
||||
<template id="assets_editor" inherit_id="website.assets_editor" name="Shop Editor">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.editor.js"></script>
|
||||
<script type="text/javascript" src="/website_sale/static/src/js/website_sale_tour_shop.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user