ACC · Rental-company scope and the all-companies flag
A member sees the cars of the rental companies on their list, or every company's cars when they hold the all-companies flag (D99, D100). A caller without the flag can't change a member outside their own set. This page holds the list, the flag, the functions that set them and the Perusahaan rental tab. Part of Access, code ACC.
Answered questions
Section titled “Answered questions”- DOC-Q13 (a member's rental companies): yes, as pack C does it: read with user:read (new rule R-ACC-34), add with user:write (R-ACC-17), remove with user:delete (R-ACC-18). Since M1-03 (#456) both go through set_company_scope() (R-ACC-134, R-ACC-135), with user:write at every active pool (R-ACC-136).
- ACC open 1 (rental-company filter) and ACC open 3, DOC-Q14 (deleting a profile): answered on #72, R-ACC-37 to R-ACC-46.
R-ACC-34 · Reading a member's rental companies needs user:read
Section titled “R-ACC-34 · Reading a member's rental companies needs user:read”- Status: built
- Example: given an admin, when they read member_rental_companies, then nothing comes back; a super_admin sees which partners each member is limited to.
- Refusal: none: hidden.
- Who: super_admin holds user:read. Changing them is set_company_scope() (R-ACC-134, R-ACC-135); the companies the editor offers are R-ACC-143.
- Source: [Ref] Roles, policy matrix (memberships, profiles, member rental companies: read user:read, write user:write, delete user:delete). Added for DOC-Q13.
R-ACC-134 · App users change a member's rental companies only through set_company_scope(); a direct insert, update or delete on member_rental_companies is refused
Section titled “R-ACC-134 · App users change a member's rental companies only through set_company_scope(); a direct insert, update or delete on member_rental_companies is refused”- Status: built
- Example: given a super_admin, when they insert or delete a member_rental_companies row for Rina directly, then it is refused and nothing changes; set_company_scope() makes the same change (R-ACC-135).
- Refusal: none: insufficient_privilege (42501), as authenticated holds no insert, update or delete on member_rental_companies. Reading it is still R-ACC-34.
- Who: every app user, super_admin included. The operator and the migration's access step (R-ACC-76) write the table as before.
- Source: D3; the lead in the session on #456 (RPC only).
R-ACC-135 · set_company_scope() replaces an active member's rental companies with the list it is given
Section titled “R-ACC-135 · set_company_scope() replaces an active member's rental companies with the list it is given”- Status: built
- Example: given Rina is limited to partners A and B, when a super_admin with the flag calls set_company_scope() for Rina's membership with partners B and C, then Rina sees B's and C's cars and not A's (R-ACC-43). Called with an empty list, Rina keeps no rental company and sees no cars (R-ACC-169). Called for a member with the flag, it takes the flag away too (R-ACC-180). Called with null instead of a list, it is refused and Rina keeps A and B. A call with the list Rina already has changes nothing. Only set_all_rental_companies() gives the flag (R-ACC-173). Ticking every company saves a list, not the flag (R-ACC-177). A caller without the flag sets only companies within their own set (R-ACC-149), and nothing for a member with the flag or linked to a company outside it (R-ACC-152).
- Refusal: each has its own rule, checked in this order:
- a null list, rather than an empty one, with access.rental_companies_required, with membership_id;
- access.member_not_found (R-ACC-141);
- access.not_allowed (R-ACC-136);
- access.member_not_active (R-ACC-142);
- access.rental_company_not_found (R-ACC-137);
- for a caller without the flag, access.rental_company_not_held, first for the member (R-ACC-152) and then for the list given (R-ACC-149);
- then access.rental_company_not_active (R-ACC-138). When both R-ACC-152 and R-ACC-149 apply, the refusal is R-ACC-152's and carries the member's rental_company_ids outside the caller's set, empty for a member with the flag.
- Who: holders of user:write at every active pool of the organization. The scope is per membership, for all pools. A caller without the flag in the organization is held to their own set (R-ACC-149, R-ACC-152), as R-ACC-50 holds a granter to their own permissions; a caller with the flag is not.
- Source: zuki in the session on #456 (one function replaces the whole set; scope stays per organization); the lead there (a null set is refused); zuki on #616, 2026-11-12 (a scoped caller is held to their own set); D99 (an empty list means no cars, not no limit); D100 (an empty list narrows). It said an empty set removed the limit.
R-ACC-180 · set_company_scope() takes away the member's flag
Section titled “R-ACC-180 · set_company_scope() takes away the member's flag”- Status: built
- Example: given Deka has the flag, when a super_admin with the flag calls set_company_scope() for Deka's membership with partner A, then Deka no longer has the flag and sees A's cars only (R-ACC-43). Called for Deka with an empty list, Deka loses the flag and sees no cars (R-ACC-169). The flag and the new list change in one transaction, so Deka never has both (R-ACC-172).
- Refusal: none. The call's refusals are R-ACC-135's.
- Who: every caller of set_company_scope() who passes its checks. A caller without the flag can't reach a member with the flag (R-ACC-152).
- Source: D99 (either the flag or a list); D100 (an empty list narrows); be in the session on #621 (the flag and the list change together). Split from R-ACC-135. Changed by zuki in the session on #748, 2026-11-25; D108.
R-ACC-136 · set_company_scope() and set_all_rental_companies() are refused to a caller without user:write at every active pool of the member's organization
Section titled “R-ACC-136 · set_company_scope() and set_all_rental_companies() are refused to a caller without user:write at every active pool of the member's organization”- Status: built
- Example: given Rina holds user:write at PML and SBY and the organization's active pools are PML, SBY and JKT, when Rina sets Deka's rental companies, or gives Deka the flag, then it is refused and nothing changes; once Rina holds user:write at JKT too, the call goes through. A closed pool doesn't count. When the organization has no active pool at all, every call is refused: the check never passes by default.
- Refusal: access.not_allowed (42501), with organization_id and the pool_ids where the caller lacks user:write; the pool_ids are empty when the organization has no active pool.
- Who: every caller of the two functions. The Perusahaan rental tab offers the save from can_set_scope, the per-member flag pool_members() returns (R-ACC-147, R-ACC-153), which is false in the same cases. Removing a rental company no longer needs user:delete (R-ACC-37). A caller who passes this check and lacks the flag is still held to their own set (R-ACC-149, R-ACC-152) and can't give the flag (R-ACC-150); can_set_scope is false too for a member outside that set.
- Source: zuki in the session on #456 (user:write at every active pool of the organization); be in the session, accepted by the lead (an organization with no active pool is refused); D99 (set_all_rental_companies()).
R-ACC-137 · set_company_scope() is refused when a rental company in the set isn't of the member's organization
Section titled “R-ACC-137 · set_company_scope() is refused when a rental company in the set isn't of the member's organization”- Status: built
- Example: given Deka is a member of organization A, when a super_admin of A and B sets Deka's rental companies to A's partner P and B's partner Q, then it is refused, nothing changes, and Deka keeps the companies they had. An id that names no rental company gets the same refusal, so it says nothing of B's companies.
- Refusal: access.rental_company_not_found, with rental_company_id. member_rental_companies carries its membership's organization, with composite foreign keys to memberships and rental_companies (R-TEN-05), so no writer can link across organizations.
- Who: every caller of set_company_scope(); every writer, through the foreign keys.
- Source: the lead in the session on #456; R-TEN-05.
R-ACC-138 · set_company_scope() is refused when it would add a link to an inactive rental company; a link the member already has to one is kept
Section titled “R-ACC-138 · set_company_scope() is refused when it would add a link to an inactive rental company; a link the member already has to one is kept”- Status: built
- Example: given partner A is inactive and Rina is limited to A and B, when a super_admin sets Rina's rental companies to A and C, then it goes through and Rina keeps A; setting Deka, who has no link to A, to A is refused and nothing changes.
- Refusal: access.rental_company_not_active, with rental_company_id.
- Who: every caller of set_company_scope().
- Source: the lead in the session on #456 (a new link to an inactive company is refused; existing links kept).
R-ACC-139 · Each set_company_scope() or set_all_rental_companies() call is one entry in the activity log, showing who made it
Section titled “R-ACC-139 · Each set_company_scope() or set_all_rental_companies() call is one entry in the activity log, showing who made it”- Status: built
- Example: given Rina is limited to partners A and B, when a super_admin sets them to B and C, then the audit log has two rows, the delete of A and the insert of C, with the super_admin as actor, under one transaction id (R-AUD-13), so the activity log lists the call once and opens to both (R-AUD-14). When a super_admin then gives Rina the flag, the update of Rina's membership and the deletes of B and C are one entry the same way. A call that changes nothing, such as giving the flag to a member who has it, or one that is refused, writes none.
- Refusal: none.
- Who: every call of the two functions. member_rental_companies is audited from M1-03, and a membership's flag with the membership; the migration's load writes its one "migrated" entry as before (R-AUD-15).
- Source: D52; the lead in the session on #456 (scope is audited); D99.
R-ACC-140 · A change to a member's rental companies or to their flag ends no sessions
Section titled “R-ACC-140 · A change to a member's rental companies or to their flag ends no sessions”- Status: built
- Example: given Rina is signed in and limited to partner A, when a super_admin sets Rina's rental companies to A and B, then Rina's sessions go on and their profile's time of last access change stays as it was; their next query sees B's cars, as permissions and scope are read on every query (R-ACC-49). Giving Rina the flag, or taking it away, ends none of Rina's sessions either.
- Refusal: none.
- Who: every member whose rental companies or flag change, through set_company_scope(), set_all_rental_companies() or the migration (R-ACC-76).
- Source: zuki in the session on #456 (a scope change ends no sessions); D37 and D48 name roles, overrides, suspension and role permissions only; D99, the lead in the session on #621 (the flag ends none).
R-ACC-141 · set_override(), clear_override(), set_company_scope() and set_all_rental_companies() are refused for a membership that doesn't exist or is in an organization where the caller holds no user:read
Section titled “R-ACC-141 · set_override(), clear_override(), set_company_scope() and set_all_rental_companies() are refused for a membership that doesn't exist or is in an organization where the caller holds no user:read”- Status: built
- Example: given Rina is super_admin of organization A only, when they call any of the four with a membership of organization B, or an id that names no membership, then it is refused, nothing changes, and the refusal says nothing of B.
- Refusal: access.member_not_found, with membership_id.
- Who: every caller of the four functions, as R-ACC-116 for roles.
- Source: D10; R-ACC-116; D99 (set_all_rental_companies()).
R-ACC-142 · set_override(), clear_override(), set_company_scope() and set_all_rental_companies() are refused when the member's membership is suspended
Section titled “R-ACC-142 · set_override(), clear_override(), set_company_scope() and set_all_rental_companies() are refused when the member's membership is suspended”- Status: built
- Example: given Deka's membership is suspended, when a super_admin sets or clears an override of Deka's at PML, sets Deka's rental companies or gives Deka the flag, then it is refused and Deka's access stays as it was; once the membership is active again, the same calls go through.
- Refusal: access.member_not_active, with membership_id.
- Who: every caller of the four functions, as R-ACC-115 for roles. Suspending and reinstating are R-ACC-187 and R-ACC-188.
- Source: zuki in the session on #455 (a suspended member is refused, with a stable key); the lead in the session on #456; D99 (set_all_rental_companies()).
R-ACC-143 · A holder of user:read in an organization can list the active rental companies the Perusahaan rental tab offers: all of the organization's when they have the flag, or only their own when they don't
Section titled “R-ACC-143 · A holder of user:read in an organization can list the active rental companies the Perusahaan rental tab offers: all of the organization's when they have the flag, or only their own when they don't”- Status: built
- Example: given partners A and B are active and C is inactive, when a super_admin with the flag reads the organization's rental companies for the editor, then A and B come back and C doesn't; an admin without user:read gets none. Given Rina holds user:read and is limited to A and to C, which is inactive, the same read returns A only: an inactive company of Rina's own isn't offered. Given Sari holds user:read and their list is empty, it returns none. For a member, the read also returns that member's links to inactive companies, so the tab can show them ticked (R-ACC-147). The names of a member's companies outside the caller's own still show, through pool_members() (R-ACC-34, R-ACC-153).
- Refusal: none: hidden.
- Who: holders of user:read in the organization, through scope_companies(); a caller's own rental companies are their links through their membership in that organization. Who sees rental_companies elsewhere is unchanged (R-ACC-45): reading it directly needs payment:read or master_data:read.
- Source: the lead in the session on #456 (the editor offers the organization's active rental companies, readable to user:read holders); be's and fe's reviews there (the member's inactive links come back too); zuki on #616, 2026-11-12 (the tab offers a scoped caller only their own companies); D99 (scoped means without the flag; the lead in the session on #621). It offered the organization's companies to a caller with no links.
R-ACC-147 · The Perusahaan rental tab shows the member's flag or rental companies and lets a holder of user:write at every active pool save a new choice
Section titled “R-ACC-147 · The Perusahaan rental tab shows the member's flag or rental companies and lets a holder of user:write at every active pool save a new choice”- Status: built
- Example: given Rina is limited to partner A, when a super_admin with user:write at every active pool and the flag opens Rina's tab, then Semua perusahaan rental is off, A is ticked and the organization's active partners are offered (R-ACC-143); ticking B and saving calls set_company_scope() with A and B (R-ACC-135). Turning Semua perusahaan rental on and saving calls set_all_rental_companies() (R-ACC-173, R-ACC-175). A link Rina keeps to an inactive company shows ticked. Given Deka holds user:write at every active pool and is limited to A and B, when Deka opens Rina's tab, then only A and B are offered. A caller lacking user:write at some active pool sees Rina's choice with no way to save (R-ACC-179 for a member with the flag). For a member with the flag, or linked to a company outside Deka's set, the tab is read-only to Deka (R-ACC-153).
- Refusal: none: a company not offered can't be ticked, and the save isn't offered without R-ACC-136. A call made anyway is refused by R-ACC-136, R-ACC-149, R-ACC-150 or R-ACC-152.
- Who: holders of user:write at the current pool, in the Sheet (R-ACC-119); saving needs it at every active pool. The tab knows whether the caller lacks the flag from caller_company_scoped(pool_id), so it can follow R-ACC-151, whether the member has the flag from pool_members()'s all_rental_companies, and whether a member is read-only to them from pool_members() (R-ACC-153).
- Source: zuki in the session on #456 (the tab; one function replaces the whole set); zuki on #616, 2026-11-12 (a scoped caller is offered only their own companies); D99; D100 (the flag has its own control).
R-ACC-148 · Saving the Perusahaan rental tab with Semua perusahaan rental off and no company ticked asks to confirm that the member will then see no cars
Section titled “R-ACC-148 · Saving the Perusahaan rental tab with Semua perusahaan rental off and no company ticked asks to confirm that the member will then see no cars”- Status: built
- Example: given Rina is limited to partner A, when a super_admin unticks A and saves, then the tab asks to confirm that Rina will see no cars (R-ACC-169); once confirmed, set_company_scope() runs with an empty list. Deka, limited to A, gets the same confirm unticking A for Rina. Saving a list that isn't empty asks nothing. Giving the flag asks its own confirm (R-ACC-178).
- Refusal: none.
- Who: holders of user:write at every active pool, with or without the flag, for a member whose tab they may save (R-ACC-147, R-ACC-153).
- Source: the lead in the session on #456 (removing the last company asks to confirm); D99 (clearing every box saves an empty list); D100 (saving an empty list asks to confirm). It asked to confirm that the member would see every rental company's cars, and only of a caller with no rental companies. Changed by zuki in the session on #748, 2026-11-25; D108.
R-ACC-149 · set_company_scope() is refused when the caller lacks the flag and the list names a company outside their own
Section titled “R-ACC-149 · set_company_scope() is refused when the caller lacks the flag and the list names a company outside their own”- Status: built
- Example: given Deka holds user:write at every active pool and is limited to partners A and B, when Deka sets Rina's rental companies, Rina being limited to A, to A and C, then it is refused, nothing changes, and Rina keeps A; setting Rina to A and B, to an empty list, or Deka's own list to A alone, goes through. Given Eko's own list is empty, any company Eko names is outside it; an empty list goes through. A super_admin with the flag may set C (R-ACC-135).
- Refusal: access.rental_company_not_held (42501), with organization_id and the rental_company_ids outside the caller's set. Checked after R-ACC-137 and before R-ACC-138 (R-ACC-135), so an id of another organization or of no company still gets access.rental_company_not_found.
- Who: every caller of set_company_scope() whose membership in the member's organization lacks the flag, whichever member they set, their own membership included. Their own set is their member_rental_companies rows through that membership, inactive companies included, and is empty when their list is.
- Source: zuki on #616, 2026-11-12 (a scoped caller sets only a subset of their own set, on any member); be in the session on #616 (the key); D99 (scoped means without the flag, an empty list included; the lead in the session on #621). R-ACC-50 is the same check for permissions.
R-ACC-150 · set_all_rental_companies() is refused when the caller lacks the flag
Section titled “R-ACC-150 · set_all_rental_companies() is refused when the caller lacks the flag”- Status: built
- Example: given Deka holds user:write at every active pool and is limited to partner A, when Deka calls set_all_rental_companies() for Rina, or for their own membership, then it is refused, nothing changes, and neither gets the flag. A super_admin with the flag gives it the same way (R-ACC-173).
- Refusal: access.scope_limit_required (42501), with membership_id. Checked after R-ACC-142 (R-ACC-173).
- Who: every caller of set_all_rental_companies() whose membership in the member's organization lacks the flag, an empty list included, on any member, their own membership included. A member with the flag is outside every such caller's set (R-ACC-152).
- Source: zuki on #616, 2026-11-12 (a scoped caller may never lift a limit, their own included); be in the session on #616 (the key); D99 (a scoped caller can never give the flag); the lead in the session on #621 (the key moves to the flag). It refused an empty set from set_company_scope(), which now saves an empty list.
R-ACC-151 · For a caller without the flag, the Perusahaan rental tab offers no Semua perusahaan rental control
Section titled “R-ACC-151 · For a caller without the flag, the Perusahaan rental tab offers no Semua perusahaan rental control”- Status: built
- Example: given Deka is limited to partner A and opens Rina's tab, Rina being limited to A, then A is offered with no Semua perusahaan rental control; unticking A and saving asks to confirm and saves an empty list (R-ACC-148). Given Sari has the flag, Deka's tab for Sari is read-only (R-ACC-153).
- Refusal: none: the control isn't offered. A call made anyway is refused by R-ACC-150.
- Who: holders of user:write at every active pool without the flag in the organization, for a member within their set (R-ACC-152). The tab knows it from caller_company_scoped(pool_id), which answers true for a caller without the flag.
- Source: zuki on #616, 2026-11-12 (the tab hides "no limit" for a scoped caller); be there (caller_company_scoped()); D99 (a scoped caller can never give the flag); D100 (an empty list narrows, so a scoped caller may save one). It disabled Save with no company ticked, with the hint "Pilih minimal satu perusahaan rental.".
R-ACC-152 · set_company_scope() is refused when the caller lacks the flag and the member has the flag or a rental company outside the caller's own
Section titled “R-ACC-152 · set_company_scope() is refused when the caller lacks the flag and the member has the flag or a rental company outside the caller's own”- Status: built
- Example: given Deka holds user:write at every active pool and is limited to partner B, and Rina is linked to A and B, when Deka sets Rina's rental companies to B alone, then it is refused, nothing changes, and Rina keeps A and B; a super_admin with the flag may. Given Rina is linked only to A, which is inactive, Deka setting Rina to B is refused the same way. Given Sari has the flag and so sees every company's cars, when Deka sets Sari's rental companies to B, then it is refused and Sari keeps the flag; only a caller with the flag may limit Sari. Given Rina is linked to B alone, or Eko's list is empty, Deka's call is held only to R-ACC-149: an empty list is within every set.
- Refusal: access.rental_company_not_held (42501), with organization_id and the member's rental_company_ids outside the caller's set, empty when the member has the flag, as R-ACC-149, and checked with it (R-ACC-135).
- Who: every caller of set_company_scope() without the flag in the member's organization. Such a caller leaves a member outside their set as they are: they can't narrow, replace or widen their list, nor limit a member with the flag. A member with the flag counts as outside, as in R-ACC-165 and R-ACC-166.
- Source: zuki on #616, 2026-11-12 and 2026-11-13 (hands off a member linked to any company outside the caller's set, or with no limit); D99 (a member with the flag is outside every scoped caller's set); D100 (a member with an empty list is within every set). It held a scoped caller to a non-empty subset.
R-ACC-153 · For a caller without the flag, the Perusahaan rental tab of a member outside their set is read-only
Section titled “R-ACC-153 · For a caller without the flag, the Perusahaan rental tab of a member outside their set is read-only”- Status: built
- Example: given Deka is limited to partner B and Rina is linked to A and B, when Deka opens Rina's tab, then A and B are listed by name, with a Nonaktif badge on an inactive one, with no checkbox and no Save, and the tab says "Anggota ini tidak terbatas pada perusahaan rental Anda, jadi perusahaan rentalnya tidak bisa Anda ubah."; Rina's tab for a super_admin with the flag is editable as R-ACC-147 says. Given Sari has the flag, Deka's tab for Sari shows the flag as text (R-ACC-179), with no checkbox and no Save, and the same reason. Given Rina is linked to B alone, or Eko's list is empty, Deka's tab is editable within B (R-ACC-143).
- Refusal: none: no change is offered. A call made anyway is refused by R-ACC-152.
- Who: holders of user:write at the current pool without the flag, in the Sheet (R-ACC-119). The tab knows it from can_set_scope, the per-member flag pool_members() returns: like can_revoke and can_clear, it is false whenever the caller can't save for that member, that is for a suspended member, without user:write at every active pool (R-ACC-136), or for a member outside the caller's set, a member with the flag included (R-ACC-152). The tab shows this rule's reason only in the R-ACC-152 case, which is when outside_scope is true (R-ACC-167); a suspended member has no Ubah akses (R-ACC-119). The names come from pool_members(), which shows every company a member is linked to to any holder of user:read (R-ACC-34).
- Source: zuki on #616, 2026-11-12 (hands off; the tab is read-only for that member; a scoped caller still sees the member's companies' names); be in the session on #616 (the flag on pool_members()); zuki on #616, 2026-11-13; D99, D100 (a member with the flag is outside; one with an empty list is within).
R-ACC-165 · grant_role() and revoke_role() are refused when the caller lacks the flag and the member has the flag or a rental company outside the caller's own
Section titled “R-ACC-165 · grant_role() and revoke_role() are refused when the caller lacks the flag and the member has the flag or a rental company outside the caller's own”- Status: built
- Example: given Deka holds user:write at PML and is limited to partners A and B, when Deka grants checker at PML to Rina, who is limited to A, or to Eko, whose list is empty, then it goes through. When Deka grants it to Ika, who is linked to A and C, or to Sari, who has the flag and so sees every company's cars, then it is refused and nothing changes; revoking a role from Ika or Sari is refused the same way. A super_admin with the flag may do either. Deka's own membership is within Deka's set, so Deka may change their own roles.
- Refusal: access.member_outside_scope (42501), with membership_id and the member's rental_company_ids outside the caller's set, ordered by company name, empty when the member has the flag. In grant_role() it is checked after access.member_not_active and before access.role_already_held (R-ACC-108); in revoke_role() after access.member_not_active and before access.role_not_held (R-ACC-109).
- Who: every caller of the two functions without the flag in the member's organization (R-ACC-154 says who that is). A member with the flag counts as outside, as in set_company_scope() (R-ACC-152): only a caller with the flag may limit them or change their roles. A member with an empty list is within every set.
- Source: zuki on #616, 2026-11-12 (R-ACC-152's hands-off test on grant_role(), revoke_role(), set_override() and clear_override(); a member with no limit counts as outside); be in the session on #616 (the key); D99 (a member with the flag is outside every scoped set); D100 (an empty list is within it). It held the caller to a non-empty subset.
R-ACC-166 · set_override() and clear_override() are refused when the caller lacks the flag and the member has the flag or a rental company outside the caller's own
Section titled “R-ACC-166 · set_override() and clear_override() are refused when the caller lacks the flag and the member has the flag or a rental company outside the caller's own”- Status: built
- Example: given Deka holds user:write at PML and is limited to partners A and B, when Deka sets a deny of payment:read at PML for Rina, who is limited to B, or for Eko, whose list is empty, then it goes through. When Deka sets or clears an override for Ika, who is linked to A and C, or for Sari, who has the flag, then it is refused and nothing changes. A super_admin with the flag may.
- Refusal: access.member_outside_scope (42501), with membership_id and the member's rental_company_ids outside the caller's set, as R-ACC-165. In set_override() it is checked after access.member_not_active and before access.override_already_set (R-ACC-125); in clear_override() after access.member_not_active and before access.override_not_held (R-ACC-128).
- Who: every caller of the two functions without the flag in the member's organization, as R-ACC-165 for roles.
- Source: zuki on #616, 2026-11-12 (the hands-off test on overrides too); D99; D100.
R-ACC-167 · For a caller without the flag, the Peran tab of a member outside their set is read-only
Section titled “R-ACC-167 · For a caller without the flag, the Peran tab of a member outside their set is read-only”- Status: built
- Example: given Deka holds user:write at PML and is limited to partner B, and Ika is linked to A and B, when Deka opens Ika's Sheet, then Peran lists Ika's roles at PML with no remove control and nothing to add, and says "Anggota ini tidak terbatas pada perusahaan rental Anda, jadi perannya tidak bisa Anda ubah."; it says the same for Sari, who has the flag. For Rina, limited to B, or Eko, whose list is empty, Peran is editable as R-ACC-120 and R-ACC-121 say.
- Refusal: none: no change is offered. A call made anyway is refused by R-ACC-165.
- Who: holders of user:write at the current pool without the flag, in the Sheet (R-ACC-119). The tab knows it from pool_members(): outside_scope is true for a member outside the caller's set, a member with the flag included, and then can_grant and every can_revoke are false; the tab shows this rule's reason only when outside_scope is true. can_set_scope is false for the same members, by R-ACC-152: their Perusahaan rental tab is read-only too (R-ACC-153).
- Source: zuki on #616, 2026-11-12 (the Roles tab goes read-only with an R-ACC-153-style reason; pool_members' flags go false); D99; D100.
R-ACC-168 · For a caller without the flag, the Pengecualian izin tab of a member outside their set is read-only
Section titled “R-ACC-168 · For a caller without the flag, the Pengecualian izin tab of a member outside their set is read-only”- Status: built
- Example: given Deka holds user:write at PML and is limited to partner B, and Sari has the flag, when Deka opens Sari's Sheet, then Pengecualian izin lists Sari's overrides at PML (R-ACC-144) with no remove control and no way to add one, and says "Anggota ini tidak terbatas pada perusahaan rental Anda, jadi pengecualian izinnya tidak bisa Anda ubah."; the same for Ika, linked to A and B. For Rina, limited to B, or Eko, whose list is empty, the tab is editable as R-ACC-145 and R-ACC-146 say.
- Refusal: none: no change is offered. A call made anyway is refused by R-ACC-166.
- Who: holders of user:write at the current pool without the flag, in the Sheet (R-ACC-119). The tab knows it from pool_members(): outside_scope is true for a member outside the caller's set, and then can_grant, which gates setting an override as it gates adding a role, and every can_clear are false; the tab shows this rule's reason only when outside_scope is true.
- Source: zuki on #616, 2026-11-12 (the Pengecualian izin tab goes read-only with an R-ACC-153-style reason); D99; D100.
R-ACC-169 · A member without the flag whose list of rental companies is empty sees no cars
Section titled “R-ACC-169 · A member without the flag whose list of rental companies is empty sees no cars”- Status: built
- Example: given Sari, an admin_fleet at PML whose membership has no flag and no member_rental_companies rows, when they read vehicles, then nothing comes back. Nor do the rows that hang off a car (R-ACC-44), rental companies, their payouts or any margin (R-ACC-45), or driver names (R-ACC-46).
- Refusal: none: hidden.
- Who: every member with neither the flag nor any rental company. Their roles and pools still apply to everything not tied to a car.
- Source: D99 (neither the flag nor any company means no cars). Before D99 such a member had no limit (R-ACC-42). Changed by zuki in the session on #748, 2026-11-25; D108.
R-ACC-170 · Only a member with the flag sees the operator's own cars, which belong to no rental company
Section titled “R-ACC-170 · Only a member with the flag sees the operator's own cars, which belong to no rental company”- Status: retired (the operator's own cars belong to the rental company TOP, which a list may name, R-ACC-43; D108)
- Example: given car B 1234 XX is the operator's own at PML, when Deka, who has the flag, reads vehicles at PML, then it comes back; when Rina, linked to every rental company of the organization, reads them, then it doesn't.
- Refusal: none: hidden.
- Who: every member. A list never includes the operator's own cars, however many companies it names.
- Source: D99 (the operator's own cars are seen only with the flag). Retired by zuki in the session on #748, 2026-11-25; D108.
R-ACC-171 · A new membership has the flag
Section titled “R-ACC-171 · A new membership has the flag”- Status: built
- Example: given a membership is made for Deka with no rental company, when it is read, then all_rental_companies is true and Deka sees every car of their pools (R-ACC-42). A membership made from an invitation with a list, or by the migration for a login with partners, is made without it (R-ACC-155, R-ACC-76).
- Refusal: none.
- Who: every membership, through memberships.all_rental_companies, which defaults to true.
- Source: D99 (a new membership has the flag).
R-ACC-172 · A membership never has the flag and a rental company at once
Section titled “R-ACC-172 · A membership never has the flag and a rental company at once”- Status: built
- Example: given Deka has the flag, when any writer adds a member_rental_companies row for Deka's membership without taking the flag away, then it is refused and nothing changes; set_company_scope() takes the flag away in the same transaction (R-ACC-180), and set_all_rental_companies() removes the links (R-ACC-173).
- Refusal: access.rental_companies_with_flag (P0001), with membership_id, raised by a trigger on member_rental_companies.
- Who: every writer, the operator and the migration's access step included.
- Source: D99 (either the flag or a list); be in the session on #621 (a trigger and its key).
R-ACC-173 · set_all_rental_companies() gives an active member the flag and removes their rental companies
Section titled “R-ACC-173 · set_all_rental_companies() gives an active member the flag and removes their rental companies”- Status: built
- Example: given Rina is limited to partners A and B, when a super_admin with the flag calls set_all_rental_companies() for Rina's membership, then Rina has the flag and no rental company, and sees every car of their pools (R-ACC-42). Given Eko's list is empty, the call gives Eko the flag the same way. Called for a member who has the flag, it changes nothing.
- Refusal: each has its own rule, checked in this order: access.member_not_found (R-ACC-141), access.not_allowed (R-ACC-136), access.member_not_active (R-ACC-142), then access.scope_limit_required (R-ACC-150).
- Who: holders of user:write at every active pool of the organization, with the flag. It is the only way an app user gives the flag. It ends no sessions (R-ACC-140) and is one entry in the activity log (R-ACC-139).
- Source: D99; be in the session on #621 (the function). Changed by zuki in the session on #748, 2026-11-25; D108.
R-ACC-174 · App users can't insert, update or delete a membership directly
Section titled “R-ACC-174 · App users can't insert, update or delete a membership directly”- Status: built
- Example: given a super_admin, when they update Rina's membership directly through PostgREST to set its status to suspended or all_rental_companies to true, delete it, or insert a membership, then it is refused and nothing changes; suspend_member(), reinstate_member(), remove_member() (R-ACC-187 to R-ACC-189) and set_all_rental_companies() (R-ACC-173) make those changes.
- Refusal: none: Postgres refuses with insufficient_privilege (42501), no key, as authenticated holds no insert, update or delete on memberships, as R-ACC-134.
- Who: every app user, super_admin included. Invitation acceptance (R-ACC-96), the operator and the migration's access step write memberships as before.
- Source: D3; be in the session on #621 (a direct write passed the scope check); the lead in the session on #457 (status and delete go through the functions too). It allowed update on status and a delete under R-ACC-37.
R-ACC-175 · The Perusahaan rental tab shows the flag as its own control, "Semua perusahaan rental"
Section titled “R-ACC-175 · The Perusahaan rental tab shows the flag as its own control, "Semua perusahaan rental"”- Status: built
- Example: given Deka has the flag, when a super_admin with the flag opens Deka's tab, then "Semua perusahaan rental" is on, above the company boxes (R-ACC-184). Given Rina is limited to A, the control is off for Rina; turning it on and saving gives the flag (R-ACC-173, R-ACC-178).
- Refusal: none.
- Who: holders of user:write at every active pool with the flag, in the Sheet (R-ACC-147). A caller without the flag never sees the control (R-ACC-151).
- Source: D99 (the tab shows the flag as every box ticked); D100 (its own control and its label). Changed by zuki in the session on #748, 2026-11-25; D108.
R-ACC-184 · While the flag control is on, every company box in the Perusahaan rental tab shows ticked and can't be changed
Section titled “R-ACC-184 · While the flag control is on, every company box in the Perusahaan rental tab shows ticked and can't be changed”- Status: built
- Example: given Deka has the flag, when a super_admin with the flag opens Deka's tab, then every company offered shows ticked and disabled. Turning the control on for Rina, limited to A, ticks and disables every box; turning it off again starts a list with every box ticked (R-ACC-176).
- Refusal: none.
- Who: holders of user:write at every active pool with the flag, in the Sheet (R-ACC-147, R-ACC-175).
- Source: D99 (the tab shows the flag as every box ticked); D100 (while it is on, every box shows ticked and can't be changed). Split from R-ACC-175.
R-ACC-176 · Turning the flag control off starts a list with every offered company ticked
Section titled “R-ACC-176 · Turning the flag control off starts a list with every offered company ticked”- Status: built
- Example: given Deka has the flag and partners A and B and TOP, the operator's own company (R-MD-84), are active, when a super_admin turns "Semua perusahaan rental" off in Deka's tab, then A, B and TOP stay ticked and become editable; saving then calls set_company_scope() with A, B and TOP (R-ACC-135).
- Refusal: none.
- Who: holders of user:write at every active pool with the flag, in the Sheet.
- Source: D100. Changed by zuki in the session on #748, 2026-11-25; D108.
R-ACC-177 · Ticking every company box by hand saves a list, not the flag
Section titled “R-ACC-177 · Ticking every company box by hand saves a list, not the flag”- Status: built
- Example: given Rina is limited to A and partners A and B are the organization's active companies, when a super_admin ticks B too and saves, then set_company_scope() runs with A and B and Rina has no flag: a company added later isn't seen.
- Refusal: none.
- Who: every caller who may save the tab (R-ACC-147).
- Source: D100. Changed by zuki in the session on #748, 2026-11-25; D108.
R-ACC-178 · Giving the flag in the Perusahaan rental tab asks to confirm that the member will then see every rental company's cars
Section titled “R-ACC-178 · Giving the flag in the Perusahaan rental tab asks to confirm that the member will then see every rental company's cars”- Status: built
- Example: given Rina is limited to partner A, when a super_admin turns "Semua perusahaan rental" on and saves, then the tab asks to confirm that Rina will see the cars of every rental company, those added later included, at their pools; once confirmed, set_all_rental_companies() runs (R-ACC-173). For a member who already has the flag there is nothing to save while the control stays on, so nothing is asked.
- Refusal: none.
- Who: holders of user:write at every active pool with the flag.
- Source: D100 (giving the flag asks to confirm; R-ACC-148 moves to it and to the empty list). Changed by zuki in the session on #748, 2026-11-25; D108.
R-ACC-179 · A viewer who can't change a member with the flag sees "Melihat semua perusahaan rental." as text, with no boxes
Section titled “R-ACC-179 · A viewer who can't change a member with the flag sees "Melihat semua perusahaan rental." as text, with no boxes”- Status: built
- Example: given Sari has the flag, when Deka, limited to B, opens Sari's Perusahaan rental tab, or an admin with user:write at PML but not at every active pool opens it, then it says "Melihat semua perusahaan rental." with no checkbox, no control and no Save; for Deka it adds R-ACC-153's reason.
- Refusal: none: no change is offered.
- Who: holders of user:write at the current pool, in the Sheet (R-ACC-119), for whom can_set_scope is false (R-ACC-153), on a member whose all_rental_companies is true in pool_members().
- Source: D100. Changed by zuki in the session on #748, 2026-11-25; D108.
R-ACC-186 · A viewer who can't change a member with an empty list sees "Tidak melihat mobil apa pun." as text, with no boxes
Section titled “R-ACC-186 · A viewer who can't change a member with an empty list sees "Tidak melihat mobil apa pun." as text, with no boxes”- Status: built
- Example: given Eko has no flag and an empty list, when an admin with user:write at PML but not at every active pool opens Eko's Perusahaan rental tab, then it says "Tidak melihat mobil apa pun." with no checkbox, no control and no Save. A caller who may save for Eko sees the boxes, none ticked (R-ACC-147).
- Refusal: none: no change is offered.
- Who: holders of user:write at the current pool, in the Sheet (R-ACC-119), for whom can_set_scope is false (R-ACC-153), on a member whose all_rental_companies is false in pool_members() and who has no rental company.
- Source: D99 (an empty list sees no cars); D100 (a viewer who can't change the member reads it as text, as R-ACC-179); the lead in the session on #621 (the text). It said "Tidak dibatasi…", which meant no limit.