Skip to main content

has_privilege

Function has_privilege 

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

Check if a specific named privilege is present on the current process token, regardless of whether it is currently enabled.

§Platform Support

This is a non-Windows stub that always returns an error. On Windows, this checks whether the named privilege exists on the process token, regardless of its enabled state.

§Errors

Always returns TokenPrivilegeError::UnsupportedPlatform on non-Windows.