PolkitPrivilegedActions class

Namespace Runic.Platform.Linux.Polkit in Runic.Platform.Linux.Polkit 0.23.0

public static class PolkitPrivilegedActions

Runs declared privileged actions through pkexec, authorized by the action's Polkit policy.

Remarks

The policy, generated from RunicPrivilegedAction items, must be installed in /usr/share/polkit-1/actions or the distribution's equivalent. Without it pkexec falls back to its generic org.freedesktop.policykit.exec action, which asks for an administrator with a generic message.

Methods

Create

public static IDesktopPrivilegedActions Create(IEnumerable<PrivilegedActionDeclaration> actions, PolkitOptions? options = null)

Creates the provider for actions, usually the generated PrivilegedActions.All.

Exceptions

ArgumentException

Two actions share an ID or a verb, or an action without a verb is not the only one.

Remarks

Off Linux, the result reports every request unavailable with PlatformUnavailableReason.BackendUnavailable.