CoolCMS API

ExternalAdminOnly
in package

FinalYes

Property or association that an external client may write only when its grant for the request comes from a role with `privileged = 1`.

The grant is $meta['__externalTier'], set by SaveTrait::actionSave(); code checks it via PermissionResolver::isGrantedByPrivilegedRole(), never by role name. Softer than ExternalReadonly, which is stripped for every external caller. OrmEntityHydrator::stripExternalAdminOnlyFieldsDeep() removes marked fields before hydration. The internal path has no marker and stays unrestricted.

IMPORTANT: when a leaf (Api) entity redeclares the property, put the attribute on the leaf. collectAllProperties() takes the first declaration from the bottom, so an attribute on Shared is shadowed and the strip does nothing.

Usage:

#[ExternalAdminOnly]
protected Collection $payments;
Attributes
#[Attribute]
\Attribute::TARGET_PROPERTY

Table of Contents

On this page
  • Table Of Contents

Search results