Not Authorized to Run Named Query From Script

When calling a Named Query in script using system.db.runNamedQuery I get the Error in the Gateway Log "Not authorized to run query:" .
I've tried setting permissions for Legacy Database Access in the project to no success.
The script is in the Project Library. I am able to run the identical system.db.runNamedQuery command in the Script Console with no issue.
Using Designer 8.1.43

Any Ideas?

A Named Query has security settings associated with it. Security Zones and Roles.

3 Likes