I created a query report, which shows a single users lead creation and modified date.Then i added the report as a chart into a dashboard. as administrator i can able to view it. i added the role for the chart also.but when try see the dashboard with other user,
This pop up message is appeared : You don’t have permission to get a report on: Lead
@Sumith-2004 U can use to remove only if creator and tick report and write permission query on lead doctype when the digital marketer role is assign to user based on your condition which role have to showcase all records or which user can show only their generated leads based on your custom condition
Example :
@frappe.whitelist()
def get_permission_query_conditions_for_lead(user):
if not user:
user = frappe.session.user
user_roles = frappe.get_roles(user)
if user != 'Administrator' and 'Digital Marketer' in user_roles:
conditions = "`tabLead`.owner= '{owner}'".format(owner=user)
return conditions
@Sumith-2004 this is doctype view permission on list for user specific which type of lead data you want showcase to login user then check your condition if that condition is match then add query so user can showcase that data only for visible