withPrivileges abstract method
When a script is run under sudo on Linux and osx and you
have previously called releasePrivileges then this method
will run privilegedCallback
with root privileges.
If you attempt to call withPrivileges when not running as a privileged process a ShellException will be thrown.
Use isPrivilegedProcess to check if your script was started as a priviliged process.
Nesting withPrivileges blocks is allowed as a convenience.
You must NEVER call releasePrivileges within a withPrivileges callback.
Implementation
void withPrivileges(RunPrivileged privilegedCallback);