Check the permissions only when run as a script.
Merge "Check the permissions only when run as a script." into develop