Skip to content

Permission registration API for packages #4

Closed

Description

@n4ff4h

The contract every next-gen package uses to ship default permissions and policies: e.g. Permissions::register('exports', ['view_exports' => 'View exports', …]) in a service provider, grouped by model/package, with translatable descriptions, plus a sync command / seeder (php artisan permissions:sync) that creates them and attaches defaults to roles. Publish it early and tell the orchestrator, since other packages build on it.

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 API summary for other packages is on the epic: #14 (comment). The docs are docs/basic-usage/registering-permissions.md and syncing-permissions.md.

    Decisions:

    • The group is stored in the existing permissions.model column, so v2 data keeps working.
    • Descriptions and labels are English strings used as translation keys (JSON lang files), so the database stays readable.
    • The sync only adds permissions to pattern roles and group grants; only '*' roles are synced exactly. This way, a deploy never undoes what an admin set on the role form.
    • --prune only touches registered groups, so permissions an app created by hand are safe.
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