Skip to main content

is_privilege_enabled

Function is_privilege_enabled 

Source
pub const fn is_privilege_enabled(
    _privilege_name: &str,
) -> Result<bool, TokenPrivilegeError>
Expand description

Check if a specific named privilege is present and enabled on the current process token.

§Platform Support

This is a non-Windows stub that always returns an error. On Windows, this looks up the privilege by name and checks if it is enabled.

§Errors

Always returns TokenPrivilegeError::UnsupportedPlatform on non-Windows.