PHPackages                             roots/acorn-user-roles - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. roots/acorn-user-roles

ActivePackage[Authentication &amp; Authorization](/categories/authentication)

roots/acorn-user-roles
======================

Simple user role management for Acorn.

v1.1.0(3mo ago)151.8k↑81.3%MITPHPPHP &gt;=8.2CI passing

Since Mar 6Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/roots/acorn-user-roles)[ Packagist](https://packagist.org/packages/roots/acorn-user-roles)[ GitHub Sponsors](https://github.com/roots)[ RSS](/packages/roots-acorn-user-roles/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Acorn User Roles
================

[](#acorn-user-roles)

[![Packagist Downloads](https://camo.githubusercontent.com/0a13094ce0f868bd420c520dfbbd393dd08d55010a626c4a2ced67ed11765734/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6f74732f61636f726e2d757365722d726f6c65733f6c6162656c3d646f776e6c6f61647326636f6c6f72423d32623330373226636f6c6f72413d353235646463267374796c653d666c61742d737175617265)](https://packagist.org/packages/roots/acorn-user-roles)[![Follow Roots](https://camo.githubusercontent.com/222256dbdeac58e77f017d847dca30ff4cab027cdf3abfec8e5bfd59de240547/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666f6c6c6f7725323040726f6f747377702d3164613166323f6c6f676f3d74776974746572266c6f676f436f6c6f723d666666666666266d6573736167653d267374796c653d666c61742d737175617265)](https://twitter.com/rootswp)[![Sponsor Roots](https://camo.githubusercontent.com/31e13361135ff96d01f1eb97157d052029e6f236249996072d8b6bd60b40e9cd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73706f6e736f72253230726f6f74732d3532356464633f6c6f676f3d676974687562267374796c653d666c61742d737175617265266c6f676f436f6c6f723d666666666666266d6573736167653d)](https://github.com/sponsors/roots)

Simple user role management for Acorn.

Support us
----------

[](#support-us)

Roots is an independent open source org, supported only by developers like you. Your sponsorship funds [WP Packages](https://wp-packages.org/) and the entire Roots ecosystem, and keeps them independent. Support us by purchasing [Radicle](https://roots.io/radicle/) or [sponsoring us on GitHub](https://github.com/sponsors/roots) — sponsors get access to our private Discord.

Requirements
------------

[](#requirements)

- [PHP](https://secure.php.net/manual/en/install.php) &gt;= 8.2
- [Acorn](https://github.com/roots/acorn) &gt;= 5.0

Installation
------------

[](#installation)

Install via Composer:

```
composer require roots/acorn-user-roles
```

Getting Started
---------------

[](#getting-started)

Start by optionally publishing the user-roles config:

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

Usage
-----

[](#usage)

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

### Adding a role

[](#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

[](#removing-a-role)

Since roles are stored in the database, removing a role from the config will not delete it. To remove a role, set it to `false`:

```
'librarian' => false,
'subscriber' => false,
```

> **Note:** Setting a role to `false` permanently removes it from the database. Removing the line from config afterward will **not** restore it. To restore a removed role, use WP-CLI: `wp role reset subscriber` (or `wp role reset --all` to restore all default roles).

### Updating an existing role

[](#updating-an-existing-role)

Capabilities defined in config are synced on every request. If you change the capabilities or display name for an existing role, the configured values will be applied.

Capabilities not included in the config are left untouched, so capabilities added by other plugins are preserved. To explicitly deny a capability, set it to `false`:

```
'editor' => [
    'capabilities' => [
        'read' => true,
        'edit_posts' => true,
        'delete_posts' => false, // explicitly denied
    ],
],
```

### Strict mode

[](#strict-mode)

If you want the config to be the single source of truth for a role, set `strict` to `true`. Any capabilities not listed in the config will be removed. In other words: `false` denies a listed capability, while `strict` removes unlisted capabilities.

```
'editor' => [
    'strict' => true,
    'capabilities' => [
        'read' => true,
        'edit_posts' => true,
    ],
],
```

Community
---------

[](#community)

Keep track of development and community news.

- Join us on Discord by [sponsoring us on GitHub](https://github.com/sponsors/roots)
- Join us on [Roots Discourse](https://discourse.roots.io/)
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
- Follow the [Roots Blog](https://roots.io/blog/)
- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)

###  Health Score

44

—

FairBetter than 91% of packages

Maintenance81

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

2

Last Release

106d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f3f71fa88954b93f55af5e121f1d8c38d240a0d17712c092a389bcccffa34415?d=identicon)[retlehs](/maintainers/retlehs)

---

Top Contributors

[![retlehs](https://avatars.githubusercontent.com/u/115911?v=4)](https://github.com/retlehs "retlehs (7 commits)")

---

Tags

acornacorn-packagelaravelwordpresswordpress-laravelwordpress-user-roles

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/roots-acorn-user-roles/health.svg)

```
[![Health](https://phpackages.com/badges/roots-acorn-user-roles/health.svg)](https://phpackages.com/packages/roots-acorn-user-roles)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
