Skip to content

BeechCMS


BeechCMS / @beechcms/core / buildEffectivePermissions

Function: buildEffectivePermissions() ​

buildEffectivePermissions(assignments, roles): EffectivePermissions

Folds a user's active assignments into their effective authority.

The model is strictly additive: every assignment can only widen the result, and assignments referencing an unknown role are ignored rather than treated as an error.

Parameters ​

assignments ​

readonly PermissionAssignment[]

Active assignments, already decay-filtered by the repository.

roles ​

readonly RoleRecord[]

The roles those assignments reference; extra roles are harmless.

Returns ​

EffectivePermissions