Skip to content

SOL Roles and Mapping

Job van Koeveringe edited this page Nov 18, 2026 · 4 revisions

SOL Roles and Mapping

Available since 2.7.0. SOL role synchronization, the Role Explorer, and role-mapping rules use information returned by Scouts Online during OIDC login. They are not a live directory of every organization or member in SOL.

Enable role synchronization

  1. Enable the optional roles scope on the managed website connection in Scouts Online.
  2. Add roles to Scouting OIDC > Settings > OpenID Connect Settings > Scopes.
  3. Complete a fresh OIDC login with a user whose role data should be available.
  4. Open Scouting OIDC > SOL Role Explorer to inspect the synchronized data.

The roles scope is opt-in and is not included in new-install defaults.

Disabling it hides both SOL role pages and the additional-default-role setting, and pauses saved role mappings and product organization/role restrictions. Existing users' WordPress roles are not reconciled while it is off; new accounts still receive the WordPress default role. Saved settings are retained for re-enabling. WooCommerce's product and global SOL sign-in-only requirements remain available and enforced. Without one of those requirements, paused product rules do not prevent guests from purchasing. With the scope enabled, unavailable role data continues to fail closed for configured assignment rules.

The plugin stores organizations, parent relationships when supplied, organization units, role definitions, and dated assignments to WordPress users. The data is refreshed during OIDC login, not by opening an administrator page or on a background polling schedule.

A missing role graph preserves stored assignments for inspection but marks them unavailable for authorization. Without mapping rules, ordinary OIDC login still preserves independent roles; new users receive the WordPress default role and existing users receive no replacement role. With mapping rules, login is blocked until a fresh login successfully synchronizes the role graph. Restricted products also fail closed for signed-in users while role data is unavailable, including deny-only restrictions.

An invalid graph or failed database write is logged and stops the OIDC login before role mapping or sign-in, rather than authorizing against old assignments. A valid explicitly empty assignment list removes the user's previously synchronized assignments. Removing the roles scope immediately makes stored assignments unavailable for authorization without deleting them. After upgrading to this freshness check, users must complete a fresh OIDC login before their assignments can authorize access. Failed synchronization does not revoke existing sessions, remove already assigned WordPress roles, or erase previously persisted data.

Since 2.7.1: after fresh role synchronization, a denied local login decision invalidates the user's existing WordPress sessions and removes plugin-managed roles, preserving manual roles and the account. This is separate from failed synchronization and does not detect SOL revocations in the background. See Offboarding and access removal.

Assignment dates and timezone

Date-only SOL assignment values are interpreted in Europe/Amsterdam, independently of the WordPress site's timezone. The start date applies from 00:00 on that date, and an einddatum remains inclusive through 23:59:59.999999 on that date. Dutch daylight-saving changes are accounted for. If the provider supplies a timestamp with an explicit offset instead, that timestamp keeps its specified instant; it is not extended to the end of a day.

These boundaries are converted to UTC when synchronized. For authorization, an assignment is active when its stored start timestamp has arrived and its end timestamp is absent or has not passed, using the database's current UTC time. The Role Explorer displays the stored UTC timestamps, not Netherlands-local dates; a start timestamp can therefore show the previous calendar date.

Already stored assignments can expire without a new login for assignment-based checks, such as product restrictions. WordPress role removals still require a successful OIDC login. Provider-side changes are not known until synchronization occurs. Existing stored timestamps are not recalculated when the site's timezone changes or the plugin is updated; a fresh OIDC login resynchronizes the dates.

Browse the SOL Role Explorer

The Role Explorer requires the WordPress manage_options capability.

  1. Choose Select an organisation, select an organization, and select Filter.
  2. Optionally select an organization unit and filter again to narrow the role choices.
  3. Optionally select a SOL role and filter again.
  4. Use Reset to clear the filters.

No assignments are shown until an organization is selected. The unit and role filters can remain All. Results show the organization, organization unit, SOL role, linked WordPress user, start date, and end date, with 50 assignments per page. Email addresses are not displayed.

The Explorer shows stored assignments, including dated assignments that may not currently be active. A row in the Explorer does not by itself prove that it qualifies for login or ordering.

Create a mapping rule

Open Scouting OIDC > SOL Role Mapping. Only users with manage_options can view or change these rules.

  1. Select Add Mapping Rule beside Test a User.
  2. Under When, select one or more organizations, organization units, or SOL roles. Populate at least one condition.
  3. For each condition, choose Is one of or Is not one of, then tick the desired checkboxes. Labels wrap so full names remain readable, including on mobile. Search to narrow the choices; results update as you type and retain every selected value. Organization and unit conditions narrow dependent choices without removing selections. Use Tab and Space to navigate and toggle checkboxes; no modifier key is needed. Clear selection empties that condition. Without JavaScript, the native multi-selects remain available: hold Ctrl (Command on Mac) while selecting multiple values, or use Shift with the arrow keys.
  4. Under Then, allow or deny Scouting OIDC login.
  5. For an allow rule, select the WordPress role to assign.
  6. Select Add Rule, or Save Rule when editing.

All selected conditions must match the same active SOL assignment. A user with multiple assignments cannot combine the organization from one assignment and the role from another to satisfy a rule.

Multiple values and exclusions

  • Is one of matches any selected value within that condition.
  • Is not one of requires the assignment to match none of those values.
  • All populated conditions must match the same assignment. Empty conditions impose no restriction, regardless of their operator.
  • A user with no active assignments never matches a rule, even an exclusion-only rule.

For example, organization Is one of [A, B] and SOL role Is one of [Leader, Treasurer] accepts a leader or treasurer assignment in either organization. It does not accept a user whose only leader assignment is in organization C.

Is not one of is assignment-level, not a user-wide absence check. Organization Is not one of [A] can match a user's assignment in B even if they also have an assignment in A. To block everyone with an assignment in A, create a separate organization Is one of [A] deny rule; any matching deny takes precedence.

Alternative combinations belong in separate rules, not nested boolean groups. Selected values that become incompatible with another condition remain visible and selected so no change silently broadens a saved rule. Review the summary and use Test a User to check the final combination.

When SOL supplies parent relationships, an organization condition also matches assignments in its descendant organizations. An exclusion likewise excludes assignments in a selected organization and its descendants. The role-mapping editor has no direct-only organization switch; the separate descendant switches described in WooCommerce SOL Access apply only to product restrictions.

The close icon, Cancel, or Escape closes a dialog without saving. Without native dialog support, the forms remain inline. Without JavaScript, the forms remain inline with native multi-selects. The WordPress Help panel explains matching, editing, managing rules, and testing.

The editor uses the available screen width with compact WordPress controls and wrapping checkbox lists. Conditions appear in three columns on wide screens and stack on smaller screens. The dialog keeps its heading and save actions visible while scrolling. Expand Selection and matching help for the full matching and keyboard instructions. Test results receive focus for screen-reader navigation without drawing a border around the entire result; interactive controls retain their visible keyboard focus.

Managing rules and outcomes

Every matching allow rule contributes its WordPress role. Duplicate roles are assigned only once. Any matching deny blocks OIDC login, even when other rules allow it. Rule order has no effect on authorization.

  • Edit opens the saved rule.
  • Duplicate opens an unsaved copy. Change its conditions or outcome before saving.
  • Delete removes the rule.

Rules have no priority numbers or position controls. Identical conditions and outcomes cannot be saved twice, even if selected values are submitted in a different order. Rapid repeat submissions are blocked in the editor; server-side checks also prevent duplicates with JavaScript disabled or across browser tabs. Different rules may still grant the same WordPress role, which is assigned once.

All matching WordPress roles are reconciled on each successful OIDC login. Previously plugin-granted roles that are no longer in the result are removed, including when assignments expire or mapping rules change. Other independently managed WordPress roles are retained, so a lower mapped role does not revoke a separate manually granted administrator role.

Role ownership is recorded only when the plugin adds a role that the user did not already have. Only those positively owned assignments are removed on a mapping change or uninstall.

If no rule matches, including when there are no active assignments or no saved rules, new users receive Settings > General > New User Default Role. Existing unmatched users lose obsolete plugin-granted roles and receive no replacement role; they may have no WordPress role left.

On the plugin Settings page, Also assign the WordPress default role when a mapping grants roles adds the default role alongside all matched allow roles for both new and existing users. This setting is disabled by default. It does not give unmatched existing users a default role, and it never overrides a deny. The additional default role is deduplicated and tracked like other plugin-granted roles. Disabling the setting removes that plugin-owned role at the next successful login unless another matching rule still grants it. Independently assigned roles are always preserved. Save the setting with the Settings page's save button; changes take effect at the next successful OIDC login, not when saved.

There is no separate default mapping rule or unmatched-user login-denial setting. Use explicit deny rules where needed.

Role mapping does not bypass provider authorization, identity binding, or Allow new user accounts. An existing account may be updated, or a new account created, before a deny decision stops login. A denied login does not delete the account. Ordinary WordPress password logins and existing authenticated sessions are not re-evaluated by these mapping rules. A denied or failed OIDC login does not reconcile WordPress roles. There is no background role refresh: provider revocation, expiry, and mapping changes affect assigned WordPress roles at the next successful OIDC login.

View and edit user roles

The WordPress Users list retains its native all-role display and adds SOL-managed WordPress roles. On profile and user-edit pages, synchronized roles are read-only and shown separately from independently assigned roles. Administrators with permission to promote the user can check multiple manual roles and save the profile. The single-role selector is replaced for OIDC users so saving the profile does not collapse their mapped roles into one.

Local accounts keep WordPress's native role controls; a stored SOL flag of false does not enable the custom editor. Single-role ownership values already stored by development builds are read as one-element role lists. This does not infer ownership from an account's current roles or from older ambiguous markers. If ownership metadata is malformed, the profile still shows the account's currently assigned roles with an explicit error. Role editing remains disabled until that metadata is corrected, protecting both managed and manual access. As in the native WordPress editor, a role manager cannot remove their own ability to manage roles through this editor; network administrators retain the native exception.

Manual roles are not removed by SOL synchronization. A role already present before a matching rule is applied remains independently managed. A tracked plugin-granted role cannot also be independently selected in this editor.

Test a user without changing access

Select Test a User, enter an exact WordPress username or user ID, and select Test User. The result shows:

  • Currently stored active SOL assignments in a table showing each actual organization, organization unit, and SOL role (not inherited parent matches).
  • Every matching saved rule, including deny rules.
  • The resulting login decision and combined WordPress roles for an existing user.

The login decision is highlighted with a text summary, followed by separate matching-rule summaries and the striped assignment table.

The tester does not sign in the user, change roles, refresh SOL data, or include unsaved rules. It previews role mapping only, not provider authorization or other login and account-creation checks.

If assignments or their organization hierarchy cannot be read from the database, the tester displays an error instead of a default-role result. OIDC authorization fails closed and the read failure is logged under the roles component. A successful query with no active assignments gives an existing user no replacement role. The tester includes the optional additional default role when a rule matches, but does not simulate account creation.

Apply changes safely

Keep a separately managed WordPress administrator account as a recovery route. Test representative users with multiple assignments, no matching rules, expired assignments, and deny conditions. Then test a real non-administrator OIDC login. Do not treat the preview as proof that the provider will allow a login.

For purchase restrictions, use WooCommerce SOL Access; its conditions are independent of login mapping, but any matching deny takes precedence in both features.

Clone this wiki locally