https://github.com/basemax/has-super-access
A lightweight Python utility to check if the current user has superuser or administrative privileges, supporting both Windows and Unix-based systems.
https://github.com/basemax/has-super-access
admin administration-system administrator py python sudo sudo-checker super-access
Last synced: 2 months ago
JSON representation
A lightweight Python utility to check if the current user has superuser or administrative privileges, supporting both Windows and Unix-based systems.
- Host: GitHub
- URL: https://github.com/basemax/has-super-access
- Owner: BaseMax
- License: mit
- Created: 2025-01-11T22:10:27.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-11T22:34:40.000Z (9 months ago)
- Last Synced: 2025-02-26T05:55:48.109Z (7 months ago)
- Topics: admin, administration-system, administrator, py, python, sudo, sudo-checker, super-access
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# has-super-access
**has-super-access** is a Python project designed to determine the current operating system and check whether the user has administrative or superuser privileges. It provides easy-to-use functions for checking platform details and user access rights across different operating systems, including Windows, Linux, macOS, and Unix-based systems.
## Features
- Detects the current operating system (Windows, Linux, macOS, or Unix).
- Checks if the user has administrative or superuser privileges.
- Displays detailed information about the operating system including name, version, release, and architecture.
- Cross-platform compatibility (Windows, Linux, macOS).## Requirements
- Python 3.x
- `platform`, `os`, `sys`, and `ctypes` standard Python libraries## Installation
To get started with the project, clone the repository:
```bash
git clone https://github.com/BaseMax/has-super-access.git
cd has-super-access
```Ensure you have Python 3.x installed. You can install Python from [here](https://www.python.org/downloads/).
## Usage
To run the script and check your system information and administrative privileges, execute the following command in your terminal or command prompt:
```bash
python app.py
```### Example Output
#### On Windows (with elevated privileges):
```
Operating System Information:
OS Name: Windows
OS Version: 10.0.26100
OS Release: 11
Architecture: 64bitYou have elevated (administrative/superuser) privileges.
```#### On Windows (without elevated privileges):
```
Operating System Information:
OS Name: Windows
OS Version: 10.0.26100
OS Release: 11
Architecture: 64bitYou do NOT have elevated privileges.
```## Functions
- `detect_platform()`: Detects the current platform and returns a string representing the operating system.
- `has_admin_privileges()`: Checks if the current user has administrative or superuser privileges.
- `get_os_info()`: Retrieves detailed operating system information (name, version, release, architecture).
- `print_system_info()`: Prints the operating system information in a readable format.## Contributing
Feel free to fork this repository, make changes, and submit pull requests. Contributions are welcome!
1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit your changes (`git commit -am 'Add new feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new pull request.## License
MIT License
(c) Copyright 2025, Max Base