withPrivilegesAsync method
Future<void>
withPrivilegesAsync(
- RunPrivilegedAsync action, {
- bool allowUnprivileged = false,
override
Identical to withPrivileges but allows you to run an async action.
Implementation
@override
Future<void> withPrivilegesAsync(
RunPrivilegedAsync action, {
bool allowUnprivileged = false,
}) async {
verbose(
() =>
'withPrivileges called on UnknownShell. '
'action called with no privilege changes.',
);
restorePrivileges();
await action();
releasePrivileges();
}