Repository navigation
Conversation
- Require PHP ^8.4, Testbench ^10 || ^11 and PHPUnit ^11.5.3 || ^12.5.8 - Branch alias dev-next-gen => 3.x-dev - Pint with Javaabu codestyle (pint.json), boost-javaabu-guidelines as a dev dependency - CI: PHP 8.4/8.5 x Laravel 12/13 x lowest/stable, a Pint job, coverage to Codecov - README badges for tests, Codecov, Packagist and licence on next-gen - Remove StyleCI and Scrutinizer configs Refs #3 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Packages register permissions, roles and policies from their service
provider; `php artisan permissions:sync` (or PermissionsSeeder) writes them.
- Permissions facade over a PermissionRegistry singleton: register(),
resource(), role(), policy(), group lookups, guard helpers, check()
- PermissionSyncer: idempotent, per guard, optional --prune; `*` roles
stay in sync, pattern roles and group grants only add permissions
- Package policies apply after boot and never replace a policy the app
set with Gate::policy(); config('permissions.policies') always wins
- ResourcePolicy base: standard abilities to view_/edit_/delete_/
force_delete_ permissions, custom $abilities, ownership, guard
- Multi-auth: default guards from config, per-group and per-role guards,
anyPermission($permissions, $guard), @anypermission($permissions, $guard),
Role/Permission forGuard() scopes, updateRole() scoped to the model's guard
- Drop the hard javaabu/helpers and javaabu/activitylog dependencies;
activity logging is optional via spatie/laravel-activitylog
- Factories and seeders move under Javaabu\Permissions\Database
Refs #4, #5, #6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Route::roles([guard, prefix, name, middleware, controller]) registers the
role routes; apps choose prefix, name, middleware and guard
- RolesController manages the roles of the route's guard; answers JSON for
API requests and renders Blade or Inertia pages by config('permissions.views')
- Controller overridable through config('permissions.controllers.roles'),
the route option or the container
- RolePolicy (view_roles, edit_roles, delete_roles) and the role permissions
are registered through the package's own registration API
- RoleRequest validates names per guard and permissions of the guard only
- RoleResource, PermissionResource and PermissionGroups for page props
- Dhivehi strings for the controller messages
Refs #11
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Docusaurus docs: installation, upgrading from v2, registering and syncing permissions, roles, policies, checking permissions, managing roles (routes, JSON API, page props), package authors, multiple guards, configuration, overriding controllers and views, activity log, translations, API reference - llms.txt with the rules and an index of every page - AGENTS.md and CLAUDE.md for agents working on the repo - resources/boost guideline and javaabu-permissions skill with references - lang/en.json beside lang/dv.json, and a test that every source string has both - README and CHANGELOG for v3; docs, llms.txt and resources/boost ship in the package Closes #4 Closes #5 Closes #6 Closes #8 Closes #11 Refs #7, #9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
On v5 the role and permission changes go in attribute_changes through withChanges(); on v4 they stay in properties. CI covers v5 on the prefer-stable legs, v4.10 on prefer-lowest, and the latest v4 in its own job. Docs show the v5 and javaabu/activitylog v2 imports. Fixes #16. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
manifest:check no longer asks Blade apps for @javaabu/forms, @javaabu/onu, React or @inertiajs/react (Javaabu/manifest#17); roles.ts imports nothing. Tests run manifest:check against Blade and Inertia app fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
javaabu/permissions v3, built on
next-genfor the Javaabu next-gen effort (epic #14). Please review and merge when ready;mainstays on 2.x until then.What's new
Permissions::register(),resource(),role(),policy()), andphp artisan permissions:sync(orPermissionsSeeder) writes them to the database. Registering never touches the database.--pruneand--guardare supported. (Permission registration API for packages #4)Gate::policy();config('permissions.policies')always wins.ResourcePolicymaps the standard abilities toview_/edit_/delete_/force_delete_permissions, with custom abilities, ownership (edit_others_x) and a per-policy guard. (Overridable policies #5)permissions.guards, per-group and per-role guards,Permissions::guardFor(),Permissions::check(), and guard-awareanyPermission()/@anypermission. Tested with two guards and two user models. (Multi-auth support #6)Route::roles(['guard' => 'web_admin']), an overridableRolesControllerthat answers JSON on every action,RoleRequest,RoleResource(withcanandlinks), and the role policy registered through the package's own API. (Overridable controllers, policies and default permissions (RBAC, multi-auth) #11)RoleForm,PermissionGroupFields,RoleActions). (Blade (javaabu/forms) and Inertia React (@javaabu/forms) views #10)Models\Translatable\Role,Support\Translations, per-language fields in both stacks, tested with and without translatable. (Optional javaabu/translatable support #12)lang/dv.json. Uncertain lines are listed for review indocs/advanced-usage/translations.md. (Dhivehi localization and RTL #9)llms.txt,AGENTS.md, and a Laravel Boost guideline and skill. (Documentation for people and agents #7, Laravel Boost guideline and skill #8)Upgrading from v2
See
docs/upgrading.md. In short:Roleno longer implementsAdminModelor usesLogsActivity; the guide shows how to extend the model to keep both. Logging ofrole_updatedandpermissions_updateduses spatie/laravel-activitylog v4 or v5 when it's installed; on v5 (javaabu/activitylog v2) the changes go inattribute_changes. (Support spatie/laravel-activitylog v5 (for javaabu/activitylog v2) #16)Javaabu\Permissions\Database\Factories.updateRole()readsconfig('permissions.default_role')instead ofget_setting().Permissions::$runsMigrationsis now$runs_migrations.translationsandlangcolumns to the roles table.PermissionsSeederarrays move toPermissions::register()in a provider.Needs a person
CODECOV_TOKENisn't available to the repo, so coverage uploads are rejected (the step doesn't fail CI). (Foundations: PHP 8.4 / Laravel 12+, CI matrix, coverage and codestyle #3)docs/advanced-usage/translations.md.🤖 Generated with Claude Code