def check_share_permission(doctype, name):
 if (not frappe.has_permission(doctype, ptype=u'share', doc=name)):
  frappe.throw(_(u'No permission to {0} {1} {2}'.format(u'share', doctype, name)), frappe.PermissionError)

def check_share_permission ( doctype , name ) : if ( not frappe . has_permission ( doctype , ptype = u'share' , doc = name ) ) : frappe . throw ( _ ( u'No permission to {0} {1} {2}' . format ( u'share' , doctype , name ) ) , frappe . PermissionError )
check if the user can share with other users .