Skip to content

Since D31 · access answers from #72

The answers to #72, the Access domain's open questions, and the CTO's review there. Pull request #116.

These take effect when the audit is done. Until then the domain pages stay as written.

  • Access: R-ACC-18 (deleting a membership, a profile or a rental-company link needs user:delete) is retired and replaced by R-ACC-37 (the same without profiles) and R-ACC-38 (profiles are never deleted).
  • Access: R-ACC-34's answer note points removal at R-ACC-37 instead of R-ACC-18.
  • Access: ACC open 1 (rental-company filter) and ACC open 3 (deleting a profile) leave "Not yet a rule"; their answers are R-ACC-37 to R-ACC-46.

R-ACC-37 · remove_member() is refused to a caller without user:delete at every active pool of the member's organization

Section titled “R-ACC-37 · remove_member() is refused to a caller without user:delete at every active pool of the member's organization”
  • Status: built
  • Example: given Rina holds user:delete at PML and SBY and the organization's active pools are PML, SBY and JKT, when Rina removes Deka's membership, then it is refused and Deka stays a member; once Rina holds user:delete at JKT too, the call goes through (R-ACC-189). An admin without user:delete is refused the same way. A closed pool doesn't count, and an organization with no active pool refuses every call. A direct delete on memberships is refused to every app user (R-ACC-174).
  • Refusal: access.not_allowed (42501), with organization_id and the pool_ids where the caller lacks user:delete, as R-ACC-136.
  • Who: super_admin holds user:delete. Suspending and reinstating need user:write the same way (R-ACC-190). A member's rental companies are removed only through set_company_scope() (R-ACC-134) or set_all_rental_companies() (R-ACC-173), which need user:write at every active pool (R-ACC-136), not user:delete; a caller without the flag sets only companies within their own set (R-ACC-149, R-ACC-152) and can't call set_all_rental_companies() (R-ACC-150).
  • Source: [Ref] Roles, policy matrix; #72 (ACC open 3, DOC-Q14). Replaces R-ACC-18 without its profile part. The rental-company link left this rule in M1-03 (#456). D99, D100: a caller is held to their own set when they lack the flag, an empty list included. Restated in M1-04 (#457), when removal became remove_member() only (D3, the lead in the session) and zuki set user:delete at every active pool, 2026-11-13; it was "deleting a membership needs user:delete", a direct delete under RLS.

R-ACC-38 · App users can't delete a profile; a person leaves an organization when the membership is removed or suspended

Section titled “R-ACC-38 · App users can't delete a profile; a person leaves an organization when the membership is removed or suspended”
  • Status: built
  • Example: given Rina works for organizations A and B, when a super_admin of A deletes Rina's profile, then nothing is deleted; suspending or removing Rina's membership in A ends their access to A and leaves B as it was.
  • Refusal: none: no effect, as there is no delete policy on profiles.
  • Who: every app user, super_admin included.
  • Source: #72 (ACC open 3, DOC-Q14): a profile is shared across organizations. A request to delete a driver's personal data is met by anonymizing (D15).

R-ACC-39 · Every active member can read the full name and avatar of the other members of their organization

Section titled “R-ACC-39 · Every active member can read the full name and avatar of the other members of their organization”
  • Status: built
  • Example: given a checker at PML, when they open an inspection approved by Rina, then they see "Rina" and Rina's avatar; Rina's phone and the rest of Rina's profile still need user:read (R-ACC-16).
  • Refusal: none: other profiles' other fields stay hidden.
  • Who: every active member, whatever their roles.
  • Source: #72 (CTO-ACC-1): pages that show who did something need the name.

R-ACC-40 · An organization always keeps at least one active member who holds user:write

Section titled “R-ACC-40 · An organization always keeps at least one active member who holds user:write”
  • Status: built
  • Example: given Deka is the only super_admin of their organization, when they remove their own super_admin role or deny themselves user:write, then the change is refused; once a second member holds user:write, the same change goes through. App users can't write memberships directly: they suspend, reinstate and remove a member only through suspend_member(), reinstate_member() and remove_member(), and those calls never leave the organization without a user:write holder (R-ACC-191, R-ACC-193). The operator and the jobs are not held to this rule: they may suspend or delete that membership.
  • Refusal: access.last_user_manager, with organization_id. revoke_role(), set_override() and clear_override() raise it too (R-ACC-109, R-ACC-125, R-ACC-128).
  • Who: app users, through revoke_role(), set_override() and clear_override(), and the membership functions. A member can't suspend or remove themself (R-ACC-193), and a caller of suspend_member() or remove_member() must hold every permission the member holds (R-ACC-191), user:write included, so through those functions the caller is always left holding it and this rule never fires there. Every path that can remove user:write (revoke_role(), set_override(), clear_override(), suspend_member(), remove_member() and the trigger that guards memberships) takes one organization-level lock before it checks, so two managers who remove each other's user:write at the same moment run one after the other, and the second is refused. The operator and the jobs are exempt.
  • Source: #72 (CTO-ACC-2): without it only a migration could restore user management. #614 (the lock: two concurrent removals each saw the other still holding user:write).

R-ACC-41 · A user without user:write can't change their own name or phone; their language is the only thing they change themselves

Section titled “R-ACC-41 · A user without user:write can't change their own name or phone; their language is the only thing they change themselves”
  • Status: built
  • Example: given a checker, when they update their own profile's full_name, then nothing changes; set_my_locale('en') goes through (R-ACC-31).
  • Refusal: none: no effect.
  • Who: every member without user:write.
  • Source: #72 (CTO-ACC-3); R-ACC-17.

R-ACC-42 · A member with the all-rental-companies flag isn't limited by rental company; only their pools apply

Section titled “R-ACC-42 · A member with the all-rental-companies flag isn't limited by rental company; only their pools apply”
  • Status: built
  • Example: given Deka, an admin_fleet at PML whose membership has the flag, when they read vehicles, then every PML car comes back, whichever rental company owns it, an inactive one included, TOP's, the operator's own company (R-MD-84), among them. When partner D is added to the organization the next day, Deka sees D's PML cars at once, with no link made.
  • Refusal: none.
  • Who: every member with the flag, memberships.all_rental_companies: ordinary staff. A new membership has it (R-ACC-171).
  • Source: #72 (ACC open 1); D99 (a flag, not one link per company, so a company added later is covered; inactive companies included, the lead in the session on #621). It said a member with no rental-company rows had no limit. Changed by zuki in the session on #748, 2026-11-25; D108.

R-ACC-43 · A member without the flag sees only the cars of the rental companies in their list

Section titled “R-ACC-43 · A member without the flag sees only the cars of the rental companies in their list”
  • Status: built
  • Example: given Rina, an outsider's account linked to partner A, with vehicle:read at PML, when they read vehicles, then partner A's PML cars come back; partner B's cars and TOP's don't. Given Nia is linked to TOP, the operator's own company (R-MD-84), the same read returns TOP's PML cars: a list may name TOP like any other company. Given Sari, whose list is empty, the same read returns nothing (R-ACC-169).
  • Refusal: none: hidden.
  • Who: every member without the flag, whether their list holds rental companies or is empty. Their roles and pools still apply on top.
  • Source: [Ref] Data model V13: member_rental_companies; #72 (ACC open 1); D99. Changed by zuki in the session on #748, 2026-11-25; D108.

R-ACC-44 · For a member without the flag, the same limit applies to the rows that hang off a car: rentals and contracts, inspections, work orders and maintenance records, gate passes, ETLE scans and violations, and rent charges

Section titled “R-ACC-44 · For a member without the flag, the same limit applies to the rows that hang off a car: rentals and contracts, inspections, work orders and maintenance records, gate passes, ETLE scans and violations, and rent charges”
  • Status: built
  • Example: given Rina, linked to partner A, when they read inspections, then only inspections of partner A's cars come back, with their items, photos and damages; a rent charge on a partner B car stays hidden. Given Sari, whose list is empty, none of these come back.
  • Refusal: none: hidden.
  • Who: every member without the flag.
  • Source: #72 (ACC open 1); D99 (an empty list sees no charges; the lead in the session on #621). It named the operator's own cars; zuki in the session on #748, 2026-11-25; D108.

R-ACC-45 · A member without the flag sees only the rental companies in their list and those companies' payouts

Section titled “R-ACC-45 · A member without the flag sees only the rental companies in their list and those companies' payouts”
  • Status: built
  • Example: given Rina, linked to partner A, when they read rental_companies, then only partner A comes back, with its payouts where Rina's permissions allow them (R-MON-40). Given Sari, whose list is empty, no rental company and no payout comes back, nor any margin.
  • Refusal: none: hidden.
  • Who: every member without the flag.
  • Source: [Ref] Roles, policy matrix (rental companies, payouts: filtered by member_rental_companies); #72; D99 (an empty list sees no rental companies, payouts or margins; the lead in the session on #621).

R-ACC-46 · A member without the flag sees only the name of a driver renting one of their rental companies' cars

Section titled “R-ACC-46 · A member without the flag sees only the name of a driver renting one of their rental companies' cars”
  • Status: built
  • Example: given Rina, linked to partner A, when they open a rental of a partner A car, then they see the driver's full name; the driver's NIK, phone, address and documents stay hidden, as does every driver not renting a partner A car. This is the exception to R-DRV-18. Given Sari, whose list is empty, no driver's name comes back.
  • Refusal: none: hidden.
  • Who: every member without the flag.
  • Source: #72 (ACC open 1, point 2); D99.