When I navigate browser address bar to the URL for the API method, I get “You do not have enough permissions to complete the action”.
If I comment out the “frappe.db.sql()” line, the script runs fine. I even tested with a placeholder response and the browser receives the response just fine. Why is frappe.db.sql causing a permission error and how do I fix it?
It contains a couple of SELECTS wrapped in CTEs. And the CTEs are used to perform a final SELECT statement.
Are you saying that Frappe Python code tries to parse the SQL to figure out what it might do? That completely boggles my mind – I never would have expected that.