Download the PHP package salvatorecervone/rolepermissionmanager without Composer

On this page you can find all versions of the php package salvatorecervone/rolepermissionmanager. 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 rolepermissionmanager

๐Ÿ›ก๏ธ Laravel Role & Permission Manager

Latest Version on Packagist Total Downloads PHP Version Laravel Version

A modern, dynamic, database-driven Role & Permission Manager for Laravel that completely replaces static middleware annotations with a centralized, zero-hardcoding Access Control Layer (ACL).


๐Ÿ’ก 100% Automatic โ€” Zero Code Changes & Coexistence

In traditional authorization setups, permissions are hardcoded into route definitions, controller constructors, or method calls:

When business rules change, developers must edit controllers, routes, commit, and deploy.

RolePermissionManager eliminates this entirely:


โœจ Features


๐Ÿ“‹ Requirements


๐Ÿ“ฆ Installation

1. Require the package via Composer

2. Publish Assets

You can publish all assets at once:

Or publish individual components using specific tags:

Component Publish Command Target Location
Config (Required) php artisan vendor:publish --tag=rolepermissionmanager-config config/rolepermissionmanager.php
Migrations (Required) php artisan vendor:publish --tag=rolepermissionmanager-migrations database/migrations/
Language Files (Optional) php artisan vendor:publish --tag=rolepermissionmanager-lang lang/vendor/acl/
Blade Views (Optional) php artisan vendor:publish --tag=rolepermissionmanager-views resources/views/vendor/acl/
Routes (Optional) php artisan vendor:publish --tag=rolepermissionmanager-routes routes/acl-web.php & routes/acl-api.php

3. Run Database Migrations

This creates 9 tables (customizable in config):


๐Ÿš€ Quick Start

1. (Optional) Add the Trait to your User Model

Adding HasAcl to your User model is optional โ€” it provides direct convenience helper methods on the user instance (e.g., $user->assignRole(), $user->hasPermission(), $user->canAccessRoute()):

Note: The dynamic middleware DynamicAclGuard, the Admin Panel, and AclRegistry work seamlessly even without modifying your User model.

2. Synchronize Application Routes

Output:

3. Open the Web Admin Panel

Navigate to https://your-domain.com/acl-admin (protected by ['web', 'auth'] middleware by default).

From the panel you can:


4. ๐Ÿ‘ฅ Multi-Model / Polymorphic Support (Optional)

If your application has multiple authenticatable models (e.g. User, Admin, Staff), configure user_models in config/rolepermissionmanager.php:

The Web Admin Panel will automatically render model selector tabs on /acl-admin/users and within the Access Simulator!


๐Ÿ› ๏ธ Artisan Commands


๐ŸŽจ Blade Directives

RolePermissionManager provides powerful, expressive Blade directives to conditionally render UI elements based on roles, permissions, routes, and custom resources, plus an automated client-side notification engine:

1. Role Verification (@role)

Checks if the authenticated user has a specific role (by slug):

2. Permission Verification (@haspermission)

Checks if the user has a permission (assigned directly or inherited through any of their roles):

3. Route Authorization Check (@canRoute)

Checks if the current user is permitted to access a specific route by its name or its METHOD:uri signature:

4. Custom Resource Authorization Check (@canResource)

Checks if the user is authorized to access an internal class method, service, or custom ACL resource:

5. Automated AJAX 403 / Denial Toast Engine (@aclAlerts or @aclToast)

Place this directive once in your master application layout (e.g. resources/views/layouts/app.blade.php before </body>):

What it does automatically (Zero Dependencies, pure Vanilla CSS & JS):


๐Ÿ›ก๏ธ Zero-Trust Auto-Discovery & Fail-Closed Protection

Protect internal controller methods, services, or sensitive business actions with a single line of code, completely eliminating human error (forgetting to register the resource or leaving methods unprotected):

How the Zero-Trust Fail-Closed Flow Works:

  1. Auto-Discovery via debug_backtrace: When AclRegistry::protect() is called for the first time, it captures the calling class, method, and source file.
  2. Instant Fail-Closed (HTTP 403 for EVERYONE):
    • If the resource has not yet been configured in the database, it is automatically created with is_unconfigured = true.
    • Access is strictly blocked with HTTP 403 Forbidden for all users, EVEN Super Admin with all_access = true.
    • No sensitive code can ever execute accidentally without explicit authorization rules in place.
  3. Admin Panel Notification:
    • An alert banner immediately appears on the Custom Resources page (/acl-admin/resources), indicating how many auto-discovered resources are awaiting configuration.
    • Filter by status ๐Ÿ”’ Awaiting Configuration (Blocked) to locate them.
  4. Configuration & Unlocking:
    • When an administrator assigns permissions (or marks the resource as public or super-admin only) and clicks Save, is_unconfigured is set to false.
    • The ACL cache is instantly refreshed, unlocking normal access for authorized users.

๐ŸŽ›๏ธ 5 Explicit Visual Access Policies (Zero Ambiguity)

In previous systems, removing all permissions from a protected route or resource would subtly default to open access for any authenticated user while still displaying a generic "Protected" badge. Role Permission Manager resolves this with 5 distinct, visually unequivocal access policies:

Policy Visual Badge Behavior
๐ŸŒ Pubblica badge-public (Green) Accessible to anyone on the internet without login.
๐Ÿ‘ค Solo Autenticati badge-authenticated (Purple) Requires authentication only; open to all logged-in users regardless of role or permissions.
๐Ÿ›ก๏ธ Con Permessi Specifici badge-protected (Blue) Requires login and matching granular permissions (OR / AND operator).
๐Ÿ‘‘ Solo Super Admin badge-superadmin (Gold) Reserved exclusively for Super Admin role (HTTP 403 for everyone else).
๐Ÿ”’ Bloccata / Da Configurare badge-unconfigured (Red) Fail-Closed lockout. HTTP 403 Forbidden for everyone, including Super Admin.

One-Click Instant Locking (๐Ÿ”’ Blocca subito)

In the edit screen of any HTTP route or custom resource, administrators can click the dedicated ๐Ÿ”’ Blocca (Fail-Closed) button to immediately sever access to any endpoint without deleting its configuration.

Bulk Policy Operations

From both the HTTP Routes and Custom Resources tables, select multiple items and apply:


๐ŸŽฏ Granular Route Parameter Rules (URI Placeholders)

Secure dynamic route parameters without writing custom controller logic or custom regex middleware. For example, on a route like /server-reports/{page}/{destination}:

  1. Automatic Placeholder Detection:
    • In /acl-admin/routes/{id}/edit, the system automatically parses and displays badges for all URI placeholders (e.g. {page}, {destination}).
  2. Per-Value Authorization:
    • Define granular permission rules for specific parameter values:
      • page = financial โž” Requires reports.view_financial
      • page = audits โž” Requires reports.view_audits (or Super Admin only)
      • page = overview โž” Mark as public access
  3. Unmatched Parameter Policy (Fallback):
    • Choose how the system reacts when a user requests an unlisted parameter value (e.g. /server-reports/malicious_page/1):
      • 404 Not Found (deny_404): Blocks probe attempts early before hitting your controller.
      • 403 Forbidden (deny_403): Rejects unauthorized values.
      • Pass-through (allow): Passes unlisted values to your controller.
  4. Zero Performance Overhead:
    • Parameter rules are compiled directly into the cached resources map and evaluated in-memory by DynamicAclGuard.

โš™๏ธ Configuration Reference

Key settings in config/rolepermissionmanager.php:


๐Ÿงช Testing & Standalone Preview

Run the test suite:

Standalone Workbench Preview (No full app required!)

Open http://127.0.0.1:8080 and log in with:


๐Ÿ“„ License

The MIT License (MIT). Please see LICENSE for more information.


All versions of rolepermissionmanager with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/routing Version ^10.0|^11.0|^12.0
illuminate/cache Version ^10.0|^11.0|^12.0
illuminate/auth Version ^10.0|^11.0|^12.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 salvatorecervone/rolepermissionmanager contains the following files

Loading the files please wait ...