Expand description
Read access control: the only place that writes the SQL guards.
A project group is either internal (everybody reads) or restricted
(only its members and administrators read). The Actor carries the
restricted groups it may not read (hidden_projects, empty for admins
except in need-to-know groups, see hidden_of_user);
every guard binds that array. Hidden objects answer with exactly the same
“not found” error as missing ones, so their existence is not confirmed.
Change orders and change requests have no group of their own; their
rules are change_visible and request_visible.
Constants§
- RESTRICTED_
LABEL - Text of a placeholder row that stands for a hidden item.
Functions§
- change_
visible - SQL guard: the change aliased
cis visible to the actor bound atactor_n(uuid) whose hidden groups are bound athidden_n. Visible to administrators, its author, its reviewers and anyone who sees every affected item of a change that has items (an empty draft is therefore visible to its author, reviewers and admins only). - change_
visible_ for change_visiblewith SQL expressions for the actor id and the hidden groups (used for notification recipients).- ensure_
visible - Fails with the regular “not found” error unless the actor may read the
project group.
not_foundis the exact error a missing object gives. - hidden_
of_ user - The groups a user may not read, as an SQL expression (
uuid[]) for the user aliasedu. Used to evaluate the change and request guards for notification recipients and to build theActor. - item_
visible - SQL guard: the item aliased
aliasis visible.nis the bind position ofactor.hidden_projects(uuid[]). - not_
found_ file - not_
found_ item - not_
found_ project - not_
found_ revision - project_
visible - SQL guard on a bare project-id expression (e.g.
w.project_id). - project_
visible_ in - Like
project_visiblewith an SQL expression for the hidden groups. - request_
visible - SQL guard: the change request aliased
ris visible: requester, assignee, or every affected item visible (which includes requests without items). - request_
visible_ for request_visiblewith SQL expressions for actor id and hidden groups.- unknown_
project - The error of a form field naming an unknown project group (also for a hidden one: its code and state are never told).
- user_
sees_ project - Recipient-side check: the user aliased
umay see an item of project expressionp(items without a group, internal groups, members, and administrators unless the group’s need-to-know policy shuts them out).