steinhaug / uarpc
User access role permission configuration - framework
Fund package maintenance!
Requires
- php: >=8.0.0
- ext-mbstring: *
Requires (Dev)
- steinhaug/mysqli: ^2.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v1.7.1
- v1.7.0
- v1.6.5
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.12
- v1.5.11
- v1.5.10
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- v0.9.9
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
This package is auto-updated.
Last update: 2026-11-23 05:13:33 UTC
README
UARPC is a PHP library that provides a flexible and easy-to-use framework for managing user access control. It allows you to define roles and permissions, assign roles to users, and check if a user has a specific permission.
Table of Contents
- UARPC - User Access, Roles, Permissions and Configurations
- Table of Contents
- 1. INSTALL
- 2. DOCUMENTATION
- 3. BRIEF HISTORY LOG
- 4. Information
1. INSTALL
To install the library, use Composer:
composer require steinhaug/uarpc
Getting Started
To start using UARPC, you need to initialize the uarpc and UARPC_base classes:
require 'vendor/autoload.php'; // Initialize the uarpc class to ensure all required files are loaded new uarpc(); // DB_PREFIX // Create a new UARPC_base instance with a user ID $uarpc = new UARPC_base($userID);
2. DOCUMENTATION
Basic Usage
Here's a simple example of how to use UARPC to manage roles and permissions:
// Create a new role $roleID = $uarpc->roles->add('Administrator', 'This is the administrator role'); // Create a new permission $permissionID = $uarpc->permissions->add('create-post', 'Allows a user to create a new post'); // Assign the permission to the role $uarpc->permissions->assign($permissionID, $roleID); // Assign the role to a user $uarpc->roles->assign($roleID, $userID); // Check if the user has the permission if ($uarpc->havePermission('create-post', $userID)) { echo 'The user has permission to create a post.'; } else { echo 'The user does not have permission to create a post.'; }
3. BRIEF HISTORY LOG
See the commit log for updates.
UARPC v1.7.1
- Upgraded steinhaug/mysqli to v2.2
UARPC v1.7.0
- Upgraded steinhaug/mysqli to v1.9
- Adding tests
UARPC v1.6.5
- Updated readme.
UARPC v1.6.4
- Added $GLOBALS['steinhaugUarpcDbPrefix'] for all classes.
UARPC v1.6.3
- Fixed composer requirements.
UARPC v1.6.2
- Added UserID parameter so it's possible to check against any user.
->havePermission(PermTitle, UserID),
UARPC v1.6.1
- Moved Mysqli2 into seperate project
4. Information
4.1 License
This project is licensed under the terms of the MIT License. Enjoy!
4.2 Author
Kim Steinhaug, steinhaug at gmail dot com.
Sosiale lenker: LinkedIn, SoundCloud, Instagram, Youtube, X, Ko-Fi, Github, Gitlab
Generative AI lenker: Udio, Suno, Huggingface
Resurser og hjelpesider: Linktr.ee/steinhaugai, Linktr.ee/stainhaug, pinterest/steinhaug, pinterest/stainhaug