I had tried to change disallow_adhoc_access, allow_in_process, dynamic_parameters value from 0 to 1
If I execute this code using sys-admin user, it works. But when I