how can i create a custom permission to a role to ...
# ask-stanley-ai
s
how can i create a custom permission to a role to use in suitescript
c
AI generated answer (using internal Slack threads):
In NetSuite, you cannot directly create a custom permission to a role to use in SuiteScript. However, you can control the execution of scripts based on the role of the user. For server-side scripts like Suitelets, you can use the 'Execute As Role' setting in the script deployment page to specify the role that the script should execute as. This allows the script to have the permissions of the specified role, regardless of the role of the user who triggers the script. For client-side scripts, they will always execute as the role of the current user. If you need part of the logic to run with different permissions, you will need to put that logic in a Suitelet and call that from your client script. In addition, on the script deployment page, you can specify the roles that are able to access the script. This allows you to restrict the execution of the script to certain roles. Here is a general process to follow: 1. Create a new role with the permissions you need for your script. 2. In your Suitelet, set the 'Execute As Role' to the role you created. 3. In your client script, make a call to your Suitelet when you need to execute logic with the permissions of the new role. 4. On the script deployment page, restrict access to the script to the roles that should be able to execute it. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.818349063
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817708194
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816987872
Please provide your feedback on this answer.