[minor] check permission for editable web page
This commit is contained in:
parent
4a67d36735
commit
89844f803d
@ -41,10 +41,12 @@
|
||||
<script>
|
||||
$(function() {
|
||||
if(window.logged_in && getCookie("system_user")==="yes") {
|
||||
wn.require("lib/js/wn/website/editable.js");
|
||||
wn.make_editable($('[itemprop="description"]'), "Item Group", "{{ name }}", "description");
|
||||
wn.has_permission("Item Group", "{{ name }}", "write", function(r) {
|
||||
wn.require("lib/js/wn/website/editable.js");
|
||||
wn.make_editable($('[itemprop="description"]'), "Item Group", "{{ name }}", "description");
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
@ -3,14 +3,15 @@
|
||||
{% block javascript %}
|
||||
<script>
|
||||
{% include "app/stock/doctype/item/templates/includes/product_page.js" %}
|
||||
|
||||
|
||||
$(function() {
|
||||
if(window.logged_in && getCookie("system_user")==="yes") {
|
||||
wn.require("lib/js/wn/website/editable.js");
|
||||
wn.make_editable($('[itemprop="description"]'), "Item", "{{ name }}", "web_long_description");
|
||||
wn.has_permission("Item", "{{ name }}", "write", function(r) {
|
||||
wn.require("lib/js/wn/website/editable.js");
|
||||
wn.make_editable($('[itemprop="description"]'), "Item", "{{ name }}", "web_long_description");
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user