https://github.com/subconsciouscompute/admin_check
Admin access check
https://github.com/subconsciouscompute/admin_check
linux osx root rust windows
Last synced: about 1 year ago
JSON representation
Admin access check
- Host: GitHub
- URL: https://github.com/subconsciouscompute/admin_check
- Owner: SubconsciousCompute
- Created: 2023-04-04T05:24:05.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-30T05:25:15.000Z (over 2 years ago)
- Last Synced: 2025-04-20T11:32:00.922Z (about 1 year ago)
- Topics: linux, osx, root, rust, windows
- Language: Rust
- Homepage:
- Size: 15.6 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# admin_check
Check if your program has admin access.
# Supported platforms
- Windows
- OS X
- Linux
## Example
```rust
use admin_check::is_elevated;
fn main() {
if !is_elevated() {
println!(
"Warning: the program isn’t running as elevated; some functionality may not work."
);
} else {
println!("The program has admin access");
}
}
```
## References
- [stackoverflow: How to check if a process has the administrative rights](https://stackoverflow.com/questions/8046097/how-to-check-if-a-process-has-the-administrative-rights)
- [rust-lang: How do I determine if I have admin rights on Windows](https://users.rust-lang.org/t/how-do-i-determine-if-i-have-admin-rights-on-windows/35710)
- [yandexx/is_elevated](https://github.com/yandexx/is_elevated)