Skip to content

Overridable controllers, policies and default permissions (RBAC, multi-auth) #11

Closed

Description

@n4ff4h
  • Controllers overridable from config or the container
  • Routes registered by a macro so apps choose prefix, middleware and guard
  • Nothing assumes the web guard or App\Models\User
  • A Policy and default permissions registered through javaabu/permissions' registration API
  • Policies overridable from config or Gate::policy()
  • Feature tests for authorization and for two guards

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Done on next-gen (c50699a). The docs are docs/basic-usage/managing-roles.md and docs/advanced-usage/overriding-controllers-and-views.md.

    • Route::roles([guard, prefix, name, middleware, controller]) stores the guard in the route action (permissions_guard) and defaults the middleware to auth:{guard}.
    • RolesController answers JSON for API requests and renders Blade or Inertia pages by config('permissions.views'). It can be overridden from config, the route option or the container.
    • RolePolicy and the view_roles/edit_roles/delete_roles permissions are registered through the package's own API; turn them off with register_defaults.
    • The tests cover authorization for every action, and two guards.

    The real Blade and React pages are tracked in #10; the controller tests use fixture views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions