is_superuser 1.0.1

A cross-platform solution for finding out if the running user is a superuser.
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 5.91 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.2 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 13s Average build duration of successful builds.
  • all releases: 13s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • irishgreencitrus/is_superuser
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • irishgreencitrus

is_superuser

A simple cross-platform solution for deciding if a given user is privileged. Works on Unix (Linux and MacOS) and Windows, please make an issue if it doesn't work for you!

Usage:

use is_superuser::is_superuser;
fn main() {
    if is_superuser() {
        println!("I am running with sudo/admin privileges!");
    } else {
        println!("I am a normal user!");
    }
}