Merge pull request #11304 from scmmishra/fix-perm-duplication-issue
fix: DocPerm duplication
This commit is contained in:
commit
03fedd0994
2 changed files with 5 additions and 3 deletions
|
|
@ -989,7 +989,8 @@ def clear_permissions_cache(doctype):
|
|||
`tabHas Role`,
|
||||
`tabDocPerm`
|
||||
WHERE `tabDocPerm`.`parent` = %s
|
||||
AND `tabDocPerm`.`role` = `tabHas Role`.`role`
|
||||
AND `tabDocPerm`.`role` = `tabHas Role`.`role`
|
||||
AND `tabHas Role`.`parenttype` = 'User'
|
||||
""", doctype):
|
||||
frappe.clear_cache(user=user)
|
||||
|
||||
|
|
|
|||
|
|
@ -334,6 +334,7 @@ frappe.PermissionEngine = Class.extend({
|
|||
});
|
||||
|
||||
this.body.on("click", "input[type='checkbox']", function() {
|
||||
frappe.dom.freeze();
|
||||
var chk = $(this);
|
||||
var args = {
|
||||
role: chk.attr("data-role"),
|
||||
|
|
@ -348,6 +349,7 @@ frappe.PermissionEngine = Class.extend({
|
|||
method: "update",
|
||||
args: args,
|
||||
callback: function(r) {
|
||||
frappe.dom.unfreeze();
|
||||
if(r.exc) {
|
||||
// exception: reverse
|
||||
chk.prop("checked", !chk.prop("checked"));
|
||||
|
|
@ -374,8 +376,7 @@ frappe.PermissionEngine = Class.extend({
|
|||
options:me.options.roles, reqd:1,fieldname:"role"},
|
||||
{fieldtype:"Select", label:__("Permission Level"),
|
||||
options:[0,1,2,3,4,5,6,7,8,9], reqd:1, fieldname: "permlevel",
|
||||
description: __("Level 0 is for document level permissions, \
|
||||
higher levels for field level permissions.")}
|
||||
description: __("Level 0 is for document level permissions, higher levels for field level permissions.")}
|
||||
]
|
||||
});
|
||||
if(me.get_doctype()) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue