Closed
Description
The ScriptRunner UI is currently unaware of the users permissions and API calls that they don't have permissions for will just fail.
This causes problems if you create a user with script_run and script_view, but not script_edit (In production you might want to not allow editing scripts), as the auto-save fails in that setup and the script won't run.
Additionally, scripts should always be shown as read_only if a user does not have script_edit permissions.
Finally, since scripts are always stored with a target, we should probably update the script permissions to support a target granularity that would allow editing/running from some targets but not others.