Skip to content

Permissions & Security

Navigation enforces layered authorization across the Admin UI, programmatic API, CLI commands, and optional Headless REST endpoints.

Permission Scope
navigation Access Setup -> Navigation (ProcessNavigation::checkAccess()), view manageable menus, and add, edit, reorder, duplicate, or delete items inside menus where $navigation->canEditMenu($menu) permits.
navigation-admin Full administrative control: create, configure, rename, and delete menu schemas (./edit-menu/), import JSON bundles (?import=1), and manage all menus regardless of per-menu restrictions.

Any YAML or database menu can specify a custom permission: (for example, permission: footer-editor). MenuDefinition validates the permission name at load time; if a menu declares a malformed or non-existent permission ($hasInvalidPermission === true), Navigation fails closed across L2 WireCache, canEditMenu(), saveMenu(), and import() so unauthorized users can never edit that menu by mistake.

Section titled “NavigationSelectorGuard & Output Sanitization”

NavigationSelectorGuard protects both admin inputs and frontend rendering:

  • Forbidden System Templates: Blocks admin, user, role, permission, and language pages from being targeted or expanded by page and children nodes (FORBIDDEN_TEMPLATES).
  • URL & Suffix Sanitization: sanitizeUrl() permits only safe schemes (https://, http://, /relative, #anchor, mailto:, tel:) and blocks javascript: or data: payloads. sanitizeUrlSuffix() validates query and anchor suffixes.
  • Allowlisted HTML Attributes: custom_attributes accepts only id, class, title, target, rel, lang, hreflang, download, aria-*, and safe data-* attributes (ALLOWED_ATTRIBUTE_PATTERN), blocking inline event handlers (onclick, onmouseover).
  • Safe Children Sorting: resolveChildrenSortField() and compileChildrenSelector() allow only validated ProcessWire fields and block FORBIDDEN_SORT_FIELDS when expanding children nodes.
  • Locked Nodes (STATUS_LOCKED): Locked navigation nodes cannot be dragged, indented, edited, or deleted in the workspace or overwritten by replace imports.
  • CSRF, Demo & Debug Hardening: All ProcessNavigation mutations validate $session->CSRF, respect $config->demo, and log internal database/filesystem exceptions (NavigationSelectorGuard::isInternalException()) to the navigation log channel while returning safe messages when $config->debug === false.

Next steps