ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Custom Permission for Multiple users


#1

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??


#2

I eventually used code to share permission to relevant parties.


#3

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


#4

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)


#5

Thanks much appreciated Ebuka_Joseph_Akeru

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