[fix] Workflow does not permit submission, duplication etc. (#4394)

If the user's roles does not contain the "Allow Edit For" role, the workflow pervents the user from performing functions such as Submit, Duplicate etc. even though the user's other roles actually allow them to perform such functions.
This commit is contained in:
Javier Wong 2017-10-27 18:03:50 +08:00 committed by Rushabh Mehta
parent 355b1d98b6
commit 1ca8707893

View file

@ -955,8 +955,8 @@ _f.Frm.prototype.validate_form_action = function(action, resolve) {
// Allow submit, write, cancel and create permissions for read only documents that are assigned by
// workflows if the user already have those permissions. This is to allow for users to
// continue through the workflow states and to allow execution of functions like Duplicate.
if (!frappe.workflow.is_read_only(this.doctype, this.docname) && (perms["write"] ||
perms["create"] || perms["submit"] || perms["cancel"])) {
if ((frappe.workflow.is_read_only(this.doctype, this.docname) && (perms["write"] ||
perms["create"] || perms["submit"] || perms["cancel"])) || !frappe.workflow.is_read_only(this.doctype, this.docname)) {
var allowed_for_workflow = true;
}