roots/acorn-user-roles

Simple user role management for Acorn.

Maintainers

Package info

github.com/roots/acorn-user-roles

Type:package

pkg:composer/roots/acorn-user-roles

Fund package maintenance!

roots

Statistics

Installs: 20

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.0 2026-03-06 03:16 UTC

This package is auto-updated.

Last update: 2026-03-06 03:21:35 UTC


README

Simple user role management for Acorn.

Requirements

Installation

Install via Composer:

composer require roots/acorn-user-roles

Getting Started

Start by optionally publishing the user-roles config:

$ wp acorn vendor:publish --provider="Roots\AcornUserRoles\AcornUserRolesServiceProvider"

Usage

User roles can be configured in the published config/user-roles.php file.

Adding a role

'librarian' => [
    'display_name' => 'Librarian',
    'capabilities' => ['read', 'edit_books', 'publish_books'],
],

Capabilities can also be defined as an associative array:

'editor_lite' => [
    'display_name' => 'Editor Lite',
    'capabilities' => [
        'read' => true,
        'edit_posts' => true,
        'delete_posts' => false,
    ],
],

Removing a role

'subscriber' => false,

Updating an existing role

Roles defined in config are kept in sync on every request. If you change the capabilities or display name for an existing role, the role will be updated to match.

Bug Reports

If you discover a bug in Acorn User Roles, please open an issue.

Contributing

Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.

License

Acorn User Roles is provided under the MIT License.