role permission holders
This block is part of the data group and was last modified in core v15.0.2.
role permission holders v15.0.2 Every subject under a root holding a permission at a path, by a role model the entity defines: who may open the doors of this room, who may edit this project, who an announcement to a role or to everyone in a channel reaches.
- model
valuerequiredthe name of a roles model the entity has (its setting roles_model_{model}), e.g. facilities, projects or chat
- root
valuethe root's guid; optional when path is given
- path
arrayscope ids from the root's first level to the leaf; empty is the root
- permission
valueempty: the members, or at a path the gate's holders
- limit
numberat most this many subjects; 0 is all
- subjects
array - count
number - success
condition - error
value
Pages through the root's members against its compiled roles, the same evaluation as roles_check, in one call instead of a check per member. A model is the entity's setting roles_model_{model} (JSON) and nothing else: none is built in, and an entity without that setting has no such model (MODEL_NOT_FOUND). It names the stores of roots, members, roles and scopes and the fields linking them, and how each permission is decided. A path is scope ids from the root's first level down to the leaf (company → building → room; org → team → project; server → channel); it must be that chain under the root, else nothing is allowed; empty is the root itself. Overrides apply root to leaf, the deepest level naming the scope deciding: by "lists" (roles list scope ids they allow and deny, "*" is every scope, explicit beats "*", higher rank wins, a deny wins a tie, the owner ignores denies) or by "entries" (roles carry [{type, enabled, scopes}], read base role first then by rank; the last entry naming the deepest named level, or covering every scope, wins; none means the model's allowed_when_unset; the owner and a root whose type allows everything allow everything, staff their staff_allowed set). A role marked by the model's role.held_by_flag_field is held by exactly the members whose member.held_flag is set. The model's gate permission, if it names one, must hold at a path before any other. Results are cached per node and every write to the model's stores is heard at once. Without permission it returns the members, or at a path those holding the model's gate there. subjects are each subject once, in member order; limit > 0 stops after that many. A path that is not the root's has no holders. A root with more than 10000 members is refused with TOO_MANY_MEMBERS, never answered in part. error: MODEL_REQUIRED, MODEL_NOT_FOUND, MODEL_INVALID, ROOT_REQUIRED, ROOT_NOT_FOUND, PATH_INVALID, PATH_UNCHECKABLE, TOO_MANY_MEMBERS, ROLES_NOT_ENABLED.
Version history
Introduced in v15.0.2.
v15.0.2: block added in this release.
Back to
data Return to the main group to view all sub-groups Back to roles Return to the group to view all blocks within this group