Documentation

Configuration

Most options change at runtime from the panel's Settings screen and need no file at all. The rest live in the config class RoleWarden\Config\RoleWarden, which you never edit: override a value in .env, or extend the class in your application.

Overriding a value

In .env, with the rolewarden. prefix:

rolewarden.tablePrefix = 'myapp_'
rolewarden.lockAttempts = 8

Or in app/Config/RoleWarden.php, for values that are not plain text or numbers:

<?php

namespace Config;

class RoleWarden extends \RoleWarden\Config\RoleWarden
{
    public array $extraThemes = ['ocean' => 'Ocean'];
    public ?string $themeStylesheet = '/css/rolewarden-theme.css';
}

Options

OptionDefaultWhat it does
tablePrefix'acl_'Prefix of every table the module creates. Set it before running the migrations.
defaultRolenullSlug of the role given to every new user, registered through Shield or created from the panel. Starting value: the Settings screen changes it. A super admin role is refused.
sessionLifetime7200Seconds a signed-in session may stay idle. Starting value of the Settings screen.
lockAttempts5Failed sign-ins on one email, since its last successful one, that lock it.
lockMinutes15How long a locked email waits.
signInRate10Sign-in attempts accepted per minute from one IP address, whatever the email.
activityRetentionDays365Days the activity log keeps its entries; 0 keeps them forever. The Settings screen offers 90 days, 1 year or forever.
colorScheme'system'Light or dark for a user who has not chosen; 'system' follows the browser.
languages[]Languages the panel offers, for example ['en']; empty offers every language it has a file for. See Languages.
extraThemes[]Themes of your application offered next to Console, Clarity and Contrast: slug => label. See Themes.
themeStylesheetnullURL of a stylesheet of your application loaded after the panel's own.

The Settings screen

/rolewarden/settings needs settings.view to open and settings.update to save. Values are stored with CodeIgniter's Settings library, in the settings table Shield already uses, and apply from each user's next request.

Sign-in limits and Shield

Security emails

The module emails a user when their account signs in from a device or address it has never used (not on the very first sign-in), when their password changes, from the profile or set by an administrator, and when their email reaches the sign-in lock. That last alert also goes to everyone holding security.alerts, once per lock.

Permissions the panel uses

PermissionAllows
users.view, users.create, users.update, users.delete, users.activateThe users list and detail, creating, editing, deleting, deactivating users
users.importThe CSV import
roles.view, roles.create, roles.update, roles.delete, roles.assignRoles, their permission matrix, assigning roles to users
permissions.view, permissions.overrideThe permission list, per-user overrides
settings.view, settings.updateThe Settings screen
sessions.view, sessions.revokeAnother user's sessions on their detail page
activity.viewThe activity log
appearance.updateThe theme for everyone
security.alertsReceiving the "too many failed sign-ins" alerts about other accounts

The system role admin holds them all; super-admin passes every check; user holds none. Profile, own sessions, language and light or dark need no permission, only being signed in.