Download the PHP package mainul/uui-role-permission without Composer

On this page you can find all versions of the php package mainul/uui-role-permission. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package uui-role-permission

mainul/uui-role-permission

Tenant-aware, UUID-first roles and permissions for Laravel 10–13 and PHP 8.1–8.4.

The package provides global and tenant roles, expiring assignments, permission caching, Laravel Gate and middleware integration, privilege-escalation guardrails, audit records, optional Sanctum session revocation, scheduled maintenance, and an optional management API.

Installation

Add Mainul\UuiRolePermission\Concerns\HasRoles to your authenticatable user model. Laravel package discovery registers the provider and RolePermission facade automatically.

For an existing RBAC database, publish and edit the configuration first, disable automatic migrations until the table mapping is correct, then inspect adoption without modifying data:

Back up production data before applying adoption migrations.

Configuration

config/uui-role-permission.php controls:

Set tenancy.enabled to false for global-only applications. When tenancy is enabled, tenant role assignments can be constrained to an active membership and active tenant.

Register permissions by stable code:

Synchronize the registry during deployment:

Synchronization is idempotent. Removed codes are deprecated instead of deleted. --dry-run previews changes; --reset-defaults explicitly resets configured default-role permissions.

Authorization

Middleware aliases:

Registered permission codes work with $user->can(...). Blade directives @permission and @role are also available. Unknown permissions fail closed. Resolver failures are logged and fail closed.

The resolver loads a user's grants in one query, memoizes them for the request, and stores them under a versioned cache key. Every package action advances the global version, so changes are visible on the next check without cache-tag support.

Safe writes

Use package actions or the trait's assignRole() and revokeRole() methods. Actions run in transactions and enforce:

Successful writes dispatch typed events derived from AccessControlChanged, invalidate permission caches, and use the configured AuditRecorder. Set audit.driver to database, null, or a custom recorder class. Session removal uses Sanctum automatically when installed or a custom SessionRevoker.

Optional management API

Set api.enabled=true. Routes use the configured API middleware plus permission middleware for reads and writes. The API includes permission and role listing, role CRUD and permission sync, user role assignments, tenant roles and memberships, and access-control audit records. Write endpoints are rate limited.

Defaults assume these registry codes exist:

Override api_permissions when your application uses different codes. The API does not create users; user lifecycle remains application-owned. See docs/openapi.yaml.

Commands and operations

Run Laravel's scheduler and a queue worker when the corresponding features are enabled:

Expired assignments and audit retention are scheduled by the service provider. Set a schedule entry to null to disable it.

Extending

Container contracts are available for PermissionRegistry, PermissionResolver, AuditRecorder, SessionRevoker, TenantResolver, and UserActivityChecker. Models can be replaced through configuration. Mainul\UuiRolePermission\Testing\InteractsWithRolePermissions provides test setup and permission assertions for host applications.

Development and support

Source and issues: github.com/Mainul12501/uui-role-permission

Run composer test, composer format:test, and composer analyse before release. The CI matrix tests Laravel 10–13 against SQLite, MySQL 8, and PostgreSQL 15. This package is released under the MIT license.


All versions of uui-role-permission with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/auth Version ^10.0|^11.0|^12.0|^13.0
illuminate/bus Version ^10.0|^11.0|^12.0|^13.0
illuminate/cache Version ^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/events Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/queue Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/view Version ^10.0|^11.0|^12.0|^13.0
laravel/framework Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mainul/uui-role-permission contains the following files

Loading the files please wait ...