Rest API give general ledger api permission to Guest

Hi,

I want to give general ledger permission to guest user using api.
i tried /api/method/frappe.desk.query_report.run but it says not permitted,

then i duplicate general ledger and added @frappe.whitelist(allow_guest=True) before execute function but it still says not permitted.

can you show full path and work you have done ? then only someone can help

Path :

/api/method/erpnext.accounts.report.account_activity.account_activity.execute?api=1&filters={"company": "Test", "report_type": "All",
	"from_date": "2020-07-20",
	"to_date": "2020-08-20",
	"group_by": "Group by Voucher Consolidated",
	"include_default_book_entries": 1}

Change in Code:

Try use ‘frappe.set_user(“Administrator”)’ or any user has proper privilege.

3 Likes

Still says not permitted.

Should put it into the def

Still same issue.

Can you share the code again please

@frappe.whitelist(allow_guest=True)
def execute(filters=None, api=0):
	frappe.set_user("Administrator")
	if not filters:
		return [], []
	if api:
		filters = json.loads(filters)
1 Like

Have you restart bench ?

Yes i did,
also tried other users that have required permissions but still same.

@youssef thanks for your time and help. it starts working after clearing caches of my browser. :+1:

2 Likes