tourze/role-based-access-control-bundle
A Symfony bundle for role-based access control (RBAC), offering roles, permissions, and access checks that integrate with your app's security layer. Configure roles and permissions to restrict resources and actions across your application.
Start by inspecting composer.json and README.md in the package root. Tourze packages are typically Symfony bundles ("type": "symfony-bundle"), so confirm whether any Laravel auto-discovery metadata (extra.laravel.providers) exists—likely it does not. Look first at DependencyInjection/, Entity/ or Model/, and Security/ directories to understand the RBAC model. Minimal steps: require the package, manually bind its services in a Laravel service provider, create role and permission records, assign a role to a user, and call the package’s access-checking service. First use case: gate an admin route—e.g. Route::get('/admin', ...)->middleware('can:admin.access')—by defining a Laravel Gate that delegates to the package’s access decision logic. Expect to write that bridge yourself.
Treat the package as an RBAC engine rather than a Laravel drop-in. Pattern 1: seed roles and permissions in a seeder, attach permissions to roles through the package’s repository or service, and assign roles to users via your own pivot table if the package expects Symfony user objects. Pattern 2: wrap access checks in Laravel middleware—resolve the package’s access checker, call something like isGranted($user, $permission), and abort with 403 on failure. Pattern 3: integrate with Laravel Gates: Gate::define('edit-posts', fn ($user) => $checker->isGranted($user, 'post.edit')); so Blade @can and can: middleware work naturally. Pattern 4: cache the user-permission map (Redis, Laravel cache) because RBAC checks are frequent; invalidate it when roles or assignments change. For workflows, keep role definitions in config or database, use role hierarchy if supported, and audit assignments. If the package exposes voters or role providers, bind custom implementations in your service provider to adapt to Eloquent models.
0.0.1 is pre-stable: the release notes are empty, there is no changelog detail, and there are no compatibility guarantees. Pin the exact version and isolate the integration behind an interface.-bundle; it likely depends on Symfony Security, Doctrine, or Symfony DI. Laravel uses Eloquent and Illuminate components—expect conflicts or missing bridges. Check composer.json for symfony/* and doctrine/* constraints before installing.vendor:publish for configuration. Symfony bundle config is usually loaded via Configuration classes; you may need to instantiate and configure services manually.app()->getBindings()) to see what the package registers; add Log::debug around access checks. If checks always fail, verify the user object implements the interface the package expects (e.g. Symfony\Component\Security\Core\User\UserInterface).0.0.1. Read source tests, if any, for expected usage.spatie/laravel-permission, Gate/Policy) unless you specifically need this package’s RBAC model.How can I help you explore Laravel packages today?