Roleline documentation1.x
Using Roleline

Multisite

How Roleline works on a network: roles per site, super admins, network activation and recovery.

On WordPress multisite every site has its own roles. Roleline follows that: each site's Users → Roles edits that site's roles, and its backups belong to that site.

Super admins

Super admins can do everything on every site, so Roleline never limits them: they can grant any capability and the lockout checks don't apply to them (WordPress gives them every capability anyway).

Site administrators who aren't super admins are limited like any non-administrator who manages roles: they can only grant capabilities they have, so they can't hand out network capabilities such as manage_network or capabilities WordPress keeps for super admins.

Network activation

Roleline can be activated for the whole network or site by site. Each site's administrators get Roleline's capability the first time someone opens that site's admin after activation, and the roles are backed up then.

There's no network-wide role editor: roles differ per site. To apply the same roles everywhere, export them from one site and import them on the others, or with WP-CLI:

wp roleline export roles.json --url=shop.example.com
for url in $(wp site list --field=url); do wp roleline import roles.json --yes --url="$url"; done

Users

User accounts are network-wide, but roles are per site. A user's profile shows and changes their roles on the site you're on.

Site administrators change the roles of their own site's users only: someone who isn't a user of the site yet is added with Users → Add Existing User first. A super admin's roles can only be changed by a super admin.

Recovery

wp roleline restore and wp roleline repair act on one site: add --url= for the site. The ROLELINE_REPAIR constant repairs the Administrator role on every site that's loaded while it's set.

Deleting Roleline

When Roleline is deleted from Network Admin → Plugins after you chose to delete its data, it's removed from every site.