fix: update all required perms form doc perms

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
This commit is contained in:
Prssanna Desai 2020-07-20 19:42:21 +05:30 committed by GitHub
parent 1023422433
commit fc3816d2de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1400,10 +1400,13 @@ frappe.ui.form.Form = class FrappeForm {
var docperms = frappe.perm.get_perm(this.doc.doctype);
for (var i=0, l=docperms.length; i<l; i++) {
var p = docperms[i];
perm[p.permlevel || 0] = {read:1, print:1, cancel:1, email:1};
if (p.share) {
perm[p.permlevel || 0].share = 1;
}
perm[p.permlevel || 0] = {
read: p.read,
cancel: p.cancel,
share: p.share,
print: p.print,
email: p.email
};
}
this.perm = perm;
}