shahid
1
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
shahid
3
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
shahid
5
Still says not permitted.
Should put it into the def
Can you share the code again please
shahid
10
@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
shahid
12
Yes i did,
also tried other users that have required permissions but still same.
shahid
13
@youssef thanks for your time and help. it starts working after clearing caches of my browser. 
2 Likes