Skip to main content

Module access

Module access 

Source
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 c is visible to the actor bound at actor_n (uuid) whose hidden groups are bound at hidden_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_visible with 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_found is 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 aliased u. Used to evaluate the change and request guards for notification recipients and to build the Actor.
item_visible
SQL guard: the item aliased alias is visible. n is the bind position of actor.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_visible with an SQL expression for the hidden groups.
request_visible
SQL guard: the change request aliased r is visible: requester, assignee, or every affected item visible (which includes requests without items).
request_visible_for
request_visible with 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 u may see an item of project expression p (items without a group, internal groups, members, and administrators unless the group’s need-to-know policy shuts them out).