Download the PHP package misaf/vendra-permission without Composer
On this page you can find all versions of the php package misaf/vendra-permission. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download misaf/vendra-permission
More information about misaf/vendra-permission
Files in misaf/vendra-permission
Package vendra-permission
Short Description Role and permission management for Vendra, built on top of Spatie Permission
License MIT
Homepage https://github.com/misaf/vendra-permission
Informations about the package vendra-permission
Vendra Permission
Role and permission management for Vendra applications.
Features
- Role and permission resources in the shared
Customerscluster - Role and permission CRUD resources
- Manage role-permission relations from role pages
- Tenant-scoped Pennant feature flags for module/resource access
- Feature toggle Artisan command per tenant
- Policy classes and enums for role/permission actions
- Translation files for
en,de, andfa - Configurable
Gate::after()admin bypass role
Requirements
- PHP 8.4+
- Laravel 13
- Filament 5
- Livewire 4
- Pest 4
- Tailwind CSS 4
laravel/pennantmisaf/vendra-supportmisaf/vendra-userawcodes/filament-badgeable-columnmisaf/filament-jalalispatie/laravel-permission
Installation
Publish Spatie Permission's configuration if it is not already present, then publish Vendra's tenant-aware permission migration:
Optional: publish module translations:
Optional: publish module config:
If you use Pennant with the database driver, ensure Pennant storage is migrated in your application.
Configuration
If you want Spatie to use this module's models everywhere in your app, set config/permission.php:
The admin bypass role is configurable in config/vendra-permission.php:
The config key is admin_role (short and local to this file).
The env var is VENDRA_PERMISSION_ADMIN_ROLE (prefixed to avoid global collisions).
It defaults to RoleEnum::Admin — the top-level role granted to a tenant administrator; admins may create additional scoped roles themselves.
This value is used for both the Gate::after() admin bypass and excluding that role from the roles table query.
Pennant feature behavior is configured in config/vendra-permission.php:
Filament
Resources are registered on the admin panel through PermissionPlugin:
- Roles
- Permissions
Both resources live in the shared Customers cluster.
Changing a role's guard goes through ChangeRoleGuardAction: each attached
permission is swapped for the permission of the same name under the new guard,
and dropped when that guard has none. Permissions are shared between roles, so
their own guard is never changed.
Access is feature-gated against the current scope returned by the shared
TenantResolver:
vendra-permission.module-enabledcontrols both resourcesvendra-permission.role-managementcontrols role resource accessvendra-permission.permission-managementcontrols permission resource accessvendra-permission.bulk-role-assignmentcontrols attach/detach role bulk actions
Pennant Features
Feature resolution must be enabled. Tenant-aware applications reject
non-tenant scopes; unresolved feature values use features.defaults.
Feature map:
| Enum case | Feature key | Short key | Effect |
|---|---|---|---|
ModuleEnabled |
vendra-permission.module-enabled |
module-enabled |
Enables or hides both permission resources |
RoleManagement |
vendra-permission.role-management |
role-management |
Enables or hides the roles resource |
PermissionManagement |
vendra-permission.permission-management |
permission-management |
Enables or hides the permissions resource |
BulkRoleAssignment |
vendra-permission.bulk-role-assignment |
bulk-role-assignment |
Enables or hides attach/detach role bulk actions |
Artisan Commands
Toggle tenant features with:
feature accepts:
- enum case name, e.g.
RoleManagement - full key, e.g.
vendra-permission.role-management - short key, e.g.
role-management all
tenant accepts:
- tenant
id - tenant
slug
The command requires vendra-permission.features.enabled to be true.
Examples:
Seed permissions and demo data for a tenant with:
Usage
Use this package's tenant feature flags and console command to control access in each tenant:
vendra-permission.module-enabledvendra-permission.role-managementvendra-permission.permission-managementvendra-permission.bulk-role-assignment
Role/permission CRUD and assignment semantics follow Spatie Permission. See: https://spatie.be/docs/laravel-permission
Demo seeders use bundled JSON fixtures in production and when their declared factory classes are unavailable. Local monorepo development continues to use factories when they are autoloadable.
Testing
Run the package checks from the project root:
License
MIT. See LICENSE.
All versions of vendra-permission with dependencies
awcodes/filament-badgeable-column Version ^4.0
laravel/pennant Version ^1.24
misaf/filament-jalali Version ^5.1.4
misaf/vendra-support Version self.version
spatie/laravel-package-tools Version ^1.93.1
spatie/laravel-permission Version ^8.0