Try ERPNext Buy Support Partners Foundation Foundation Members

Custom Permission for Multiple users

Hi Everyone, I have a doctype with “Applicant” and “Delegate” fields that can be populated automatically from another doctype or manually by system manager,
I want to create custom permissions for both the Applicant and Delegate in the document to be able to view the document,Is there a more hassle free way to implement this without creating individual User permissions??

I eventually used code to share permission to relevant parties.

Please share your learning here - for example your code or references you found that helped, to inform others thanks!

I imported the frappe share library with
from frappe.share import add ,
Added the user emails to a list called “users” and shared the document with the relevant employees by
for each in users:
add(form.doctype,form.name,each,read=True,write=False,share=False,everyone=False)

Thanks much appreciated Ebuka_Joseph_Akeru

Your note will help someone maybe even you too - if your memory is like mine :slight_smile:

1 Like