Skip to content

Permissions & Access Control

Entries enforces two-stage Role-Based Access Control (RBAC) plus field-level ACLs and two-tier locking so you can grant focused access to editors while protecting sensitive data and schema tools. Superusers always bypass permission checks.

Installing Entries (with ProcessEntries) creates three ProcessWire permissions under Access -> Permissions:

Permission Scope
entries-single Access and edit Single blueprints under Setup -> Entries -> Singles
entries-collection Access and edit Collection blueprints under Setup -> Entries -> Collections
entries-admin Full workspace access including Blueprint Schemas, Managed Tables, Health & Index, Activity Log, Transfer & Seed, and exports

Assign these permissions to staff roles under Access -> Roles.

Narrow access for any individual blueprint with a permission string or an action-scoped permissions: map:

site/entries/collections/rates.yaml
title: Charter Rates
kind: collection
permission: rates-view
permissions:
view: rates-view
create: rates-edit
edit: rates-edit
delete: rates-admin
export: rates-admin

The same policy applies to embedded @fieldset:* and pivot schemas edited via FieldtypeEntries on ProcessWire pages, as well as non-CLI exports (CSV, JSON, ZIP).

Field-level permissions and sensitive fields

Section titled “Field-level permissions and sensitive fields”

Restrict individual fields by role or permission directly inside fields::

fields:
internal_cost:
type: float
label: Internal Cost
viewRoles: [finance, manager]
editRoles: [finance]
webhook_secret:
type: secret
label: Webhook Secret
permission: entries-admin
sensitive: true
  • Users who match viewRoles but not editRoles see the field in read-only mode.
  • Fields marked sensitive: true (or type: secret) are masked in tables, redacted in revision snapshots and draft preview tokens, and omitted from non-privileged exports.

Entries supports locking at both the schema level and the individual record level:

  1. Tier 1 (Blueprint-level lock): Set locked: true on a blueprint to make every record of that blueprint read-only ($item->isBlueprintLocked()).
  2. Tier 2 (Record-level lock): Add EntryItem::STATUS_LOCKED (16) to an individual record ($item->isLocked()). Locked records cannot be edited, trashed, or deleted until unlocked by an authorized user.

Optimistic concurrency control and error codes

Section titled “Optimistic concurrency control and error codes”

Guard against lost updates when two editors or background jobs update the same record simultaneously by passing the loaded modified timestamp to setExpectedModified():

<?php
declare(strict_types=1);
namespace ProcessWire;
use Totoglu\Entries\Storage\EntryRepository;
$entries = $this->wire()->entries;
$season = $entries->findOne('type=seasons, code=HIGH_2026');
if ($season !== null) {
$season->setExpectedModified($season->modified);
$season->set('rate_multiplier', 1.55);
try {
$entries->save($season);
} catch (WireException $e) {
if ($e->getCode() === EntryRepository::ERR_CONFLICT) {
// Another user updated this record first
}
}
}
Constant Code Trigger
EntryRepository::ERR_INVALID_PARENT 2001 Invalid parent_id, self-parenting, or exceeding 2-level hierarchy depth
EntryRepository::ERR_DUPLICATE_VALUE 2002 Violation of a blueprint unique constraint
EntryRepository::ERR_VALIDATION_FAILED 2003 Field validation or custom EntryItem::validate() failure
EntryRepository::ERR_REFERENCE_RESTRICTED 2004 Deleting a restrictOnDelete: true entry that is still referenced
EntryRepository::ERR_LOCKED_ITEM 2005 Trashing a locked entry (STATUS_LOCKED or blueprint->locked)
EntryRepository::ERR_CONFLICT 4092 Optimistic concurrency conflict via setExpectedModified()
<?php
declare(strict_types=1);
namespace ProcessWire;
$entries = $this->wire()->entries;
// Boolean capability check
if ($entries->can('rates', 'publish')) {
// Allowed to publish rates
}
// Throw 403 WirePermissionException if unauthorized
$blueprint = $entries->registry()->get('rates');
if ($blueprint !== null) {
$entries->assertPermission($blueprint);
}
$entries->assertAdminPermission();

Next steps