feat: assign default value to link field based on the user permission
This commit is contained in:
parent
34256b8ff5
commit
b53ff42bcd
1 changed files with 1 additions and 1 deletions
|
|
@ -525,7 +525,7 @@ def allow_everything():
|
|||
def get_allowed_docs_for_doctype(user_permissions, doctype):
|
||||
'''Returns all the docs from the passed user_permission
|
||||
that are allowed under provide doctype'''
|
||||
return [d.get('doc') for d in user_permissions if not d.get('applicable_for') or d.get('applicable_for') == doctype]
|
||||
return [d.get('doc') for d in user_permissions if (not d.get('applicable_for') or d.get('applicable_for') == doctype) and (d.get('is_default') or len(user_permissions) == 1)]
|
||||
|
||||
def push_perm_check_log(log):
|
||||
if frappe.flags.get('has_permission_check_logs') == None: return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue