How to call RESTlet with admin role from netsuite ...
# suitescript
m
How to call RESTlet with admin role from netsuite ?
e
RESTlets execute as admin by default
m
no(
i use some module from restlet and if some role execute have permission
j
?
m
RESTlets use the credentials/roles/permissions of the caller. You cannot configure a RESTlet to execute as Administrator. If you need your endpoint to do things that the calling user is not permitted to do, you can change your RESTlet to a Suitelet and still return a JSON response. The Suitelet can be configured to execute as Administrator.
m
@Mike Robbins, thanks. Have you had any experience with replacing headers to solve this problem?
m
Just in setting the
Content-Type
on the outbound suitelet response.
Copy code
context.response.setHeader({
            name: 'Content-Type',
            value: 'application/json'
        });

        context.response.write({ 
            output: JSON.stringify(data) 
        });
👀 1
👌 1
111 Views