def get_shared_doctypes(user=None): """Return list of doctypes in which documents are shared for the given user.""" if not user: user = frappe.session.user return frappe.db.sql_list("select distinct share_doctype from tabDocShare where (user=%s or everyone=1)", user)