Skip to content

Ma trận quyền ​

Trang sinh tự động

Nguồn: code/apps/api/supabase/functions/_shared/contracts/permission-matrix.json. Không sửa tay.

Đây là file mà Edge Function nạp lúc chạy để quyết định cho phép hay từ chối, nên nó là nguồn thật của phân quyền — không phải tài liệu mô tả lại.

Phiên bản 0.1.0 · 162 luật · 12 vai trò · 3 ứng dụng.

Cách đọc ​

Mỗi luật nối một quyền (resource.action) với các vai trò được giữ quyền đó, trong những ứng dụng nào, ở phạm vi nào. Quyền hiệu lực là các grant còn sống của người gọi, đọc lại ở mỗi request — token không chứa quyền.

Phạm vi: PUBLIC · SELF · OWN · ASSIGNED · TEAM · ALL · UNDECIDED

Vai trò: anonymous · user · sale · sale_manager · operations · finance · finance_manager · business_owner · marketing · bi_viewer · admin · super_admin

Cờ bổ sung trên một luật: maker/checker (phải hai người khác nhau), mfa (cần xác thực bước hai cho hành động đó), export (cần yêu cầu đã được duyệt), không tự làm (đối tượng phải khác người thực hiện), pii (dữ liệu cá nhân bị che hay không), snapshot (đọc theo ảnh chụp lịch sử, chỉ với phạm vi TEAM).

Trạng thái luật: DEFINED 25 · PROPOSED 122 · GAP 15. DEFINED = có nguồn trong tài liệu thiết kế hoặc user story. PROPOSED = hành vi đã có nguồn nhưng tên quyền còn chờ chốt. GAP = từ chối cho tới khi có quyết định.

Luật theo tài nguyên ​

order ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
M-02order.readWEB_ADMINsale_managerTEAMpii:maskedDEFINEDPD-08 s14
O-02order.manageWEB_ADMINoperations adminALLPROPOSEDPD-08 s15 (GAP-01); DEC-OPS-SCOPE decided 2026-10-06 (owner-questions-2026-10-06 OQ-46, extends owner answer #52): Operations holds ALL scope for order.manage (shipment writes, delivery exceptions, RETURN case of a refused COD; FU-OPSSCOPE, closes GAP-01 for this rule) FU-OPSGRANTS DEC-OPS-ADMIN-ALL decided 2026-10-07: admin also holds order.manage at ALL (GAP-1920 resolved).; DEC-COD-REFUND-MAKER (decided 2026-10-07, closes GAP-1940): recordCodRefusalReturn (this rule) is a DELIBERATE SYSTEM STEP: in the same transaction it opens the manual refund case of the refused COD and the recorder IS the maker of that case (requested_by), with no F-02 payment.refund.request right needed; a DIFFERENT Finance account approves (F-03 / FRM-01, MAKER != CHECKER in the guard, refund_decide and the table CHECK), so the recorder cannot also approve | U19-P0-04: shipment writes move to SHP-02 shipment.create / SHP-03 shipment.update; requireShipment still accepts order.manage until U19-P4-02.
OPS-02order.readWEB_ADMINoperations adminALLpii:maskedPROPOSEDFU-OPSSCOPE; DEC-OPS-SCOPE decided 2026-10-06: Operations reads orders at ALL: adminOrders, orderEvents, shipments, shipment, orderDeliveryProgress, fulfillmentExceptions and the RETURN case reads orderReturnCase / orderReturnCases (GAP-91, GAP-51, GAP-111, GAP-1320; P5-A16, A22, A23). PII stays MASKED in the database (no customer.pii.read role, GAP-12) FU-OPSGRANTS DEC-OPS-ADMIN-ALL decided 2026-10-07: admin also reads orders at ALL, PII MASKED (GAP-1920 resolved). FU-F1 DEC-OPS-PERIOD-MONEY decided 2026-10-07 (interim): Operations also reads the money of each period in AdminOrder.periods (visibility rule, no new permission, no payment.read grant; GAP-2140 resolved, GAP-2190, GAP-2191). | U19-P0-04: shipment reads move to SHP-01 shipment.read; requireShipment(read) still accepts order.read until U19-P4-02.
ORD-01order.cancelWEB_ADMINoperations adminALLDEFINEDB269.R07 (NFR6); B048 (DH-US-08 Hủy đơn). U19-P0-04 (Word v2 Đơn hàng/Vận đơn, NFR #6 B269.R07: xem, hủy đơn, xử lý hoàn tiền, tạo vận đơn, cập nhật vận chuyển là các quyền tách riêng). Interim role mapping operations + admin ALL (the Phân quyền module owns the detailed design). Seeded by 20261223000000 § permissions_word_v2. opsCancelOrder and opsOrderCancelPreview guard on this rule; until U19-P4-02 the guard also accepts SHR-01/SHR-02 ops.shortage (transition, shortage/guards.ts).
S-02order.readAPP_SALEsaleASSIGNEDpii:maskedDEFINEDPD-08 s14
SKP-01order.request_skipAPP_USERuserOWNPROPOSEDP2-18; UA-15 Rule 2 ('Skipping a cycle within the limit n must be recorded', skip row: action only if approved), UA-12 AC04/AC07 (a valid skip is not a payment and does not cancel), A-OPS-03 ALT01 (withdraw before processing); mutations requestCycleSkip and cancelCycleSkip act on the caller's own Recurring order only (cycleSchedule reuses U-01 order.read); SQL mirror ordering.is_buyer() + owner = actor in campaign.order_skip_state/record_cycle_skip/cancel_cycle_skip; the grant does not enable skipping: every request is policy_undecided DEC-CP-SKIP (G-CP) until a rule is approved; permission name not in PD-08 s15 (GAP-05, GAP-110)
U-01order.readAPP_USERuserOWNDEFINEDPD-08 ST-AUTHZ-01
U-02order.createAPP_USERuserOWNPROPOSEDcatalog submitGroupOrder/submitRecurringOrder | G2S (#422): also adoptRecurringBasket (S3, DR-01: the device basket replaces the own DRAFT on sign-in), like saveRecurringBasketDraft.
U-03order.request_cancelAPP_USERuserOWNPROPOSEDcatalog requestOrderCancellation

customer ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
M-01customer.readWEB_ADMINsale_managerTEAMpii:maskedDEFINEDPD-08 s14 Sale Manager TEAM; A-SEC-04 EC01
O-01customer.readWEB_ADMINoperations adminALLpii:maskedPROPOSEDPD-08 s14: TEAM/ALL per permission (GAP-01); FU-OPSGRANTS DEC-OPS-CUSTOMER-READ decided 2026-10-07 (owner message): temporarily operations and admin read the customer list and detail at ALL, PII MASKED, until the detailed role and permission design (GAP-1921 resolved, GAP-2015)
O-04customer.exportWEB_ADMINoperations adminALLmfa, pii:maskedPROPOSEDPD-08 SR-003, s19 bulk PII export; NFR-PRI-005 (GAP-01); FU-OPSGRANTS DEC-OPS-CUSTOMER-READ decided 2026-10-07: operations and admin hold the export maker code at ALL (MFA, MAKER, masked file); exportCustomers still needs an APPROVED request that no store provides (GAP-63, GAP-2016); interim until the detailed role design (GAP-2015) | U6-P2-23 (final 05-quan-ly-khach-hang.md KH-US-02 AC01-AC05 'xuat toan bo ket qua loc', NFR #4; contract-freeze s7, X-05, GAP-U6-01 REQUIREMENT_DELTA): export / mc MAKER removed (no approval request, no reason, no 10.000 cap); MFA kept; file PII FULL through O-05 (evaluator upgrade). Seed unchanged (20261121010000).
OPS-03customer.writeWEB_ADMINoperations adminALLPROPOSEDFU-OPSGRANTS DEC-OPS-CUSTOMER-READ decided 2026-10-07 (owner message): temporarily operations and admin have full rights on the customer admin area at ALL (GAP-25 resolved for these keys, GAP-2015 interim until the detailed role design); saveCustomer, transferCustomerGroup (P2-04, KH-US-01/03; web customer edit page and bulk transfer)
S-01customer.readAPP_SALEsaleASSIGNEDpii:maskedDEFINEDPD-08 s14 Sale: assigned customer/order; Sale DS: PII masked
X-01customer.export.approveWEB_ADMINadminALLchecker, mfaPROPOSEDPD-08 s19 checker Data Owner/Admin

media ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
MD-01media.uploadAPP_USER, APP_SALEuser saleOWNPROPOSED4-media-management M-01/M-04, s2.4 user/sale OWN; catalog createMediaUpload/completeMediaUpload; P1-11
MD-02media.readAPP_USER, APP_SALEuser saleOWNPROPOSED4-media-management s2.4 user/sale OWN; catalog media/mediaSignedView; P1-11
MD-03media.deleteAPP_USER, APP_SALEuser saleOWNPROPOSED4-media-management s1.6/s2.4 soft delete OWN; deleteMedia; P1-11
MD-04media.uploadWEB_ADMINadmin marketing operationsOWNPROPOSED4-media-management s2.4 (admin/marketing/operations add to the user set); BRD-AP-04 product images, BRD-AP-14 CMS; P1-11; U6-P3-38 (K-19): except PRODUCT_IMAGE (MD-12/13 catalog_media) and SALE_PROFILE_* (MD-14/15 sale_media); AVATAR/CMS_MEDIA/INTERNAL_DOCUMENT keep MD-04
MD-05media.readWEB_ADMINadmin marketing operationsALLPROPOSED4-media-management M-02, s2.4 media.read ALL; PUBLIC media only, another account's PRIVATE media needs MD-07 (GAP-18); P1-11
MD-06media.deleteWEB_ADMINadmin marketing operationsALLPROPOSED4-media-management s2.4 media.delete ALL; PUBLIC media only, another account's PRIVATE media needs MD-08 (GAP-18); P1-11

sale_application ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
AD-07sale_application.reviewWEB_ADMINadmin super_adminALLmfa, không tự làmPROPOSEDP1-12 + FU-SALEREVIEWER: AP-19/SALE-BRULE-06 approve/reject with reason; catalog reviewSaleApplication; DEC-S-APPLICATION-REVIEWER (owner answer 2026-10-06, OQ-47): the existing admin role (ALL scope) reviews Sale applications with MFA step-up, super_admin as with every Admin-level rule; reviewer != applicant enforced by the service, RLS and CHECK regardless; grant seeded by 20261114010000 (-- rbac-forward-grants); SQL mirror sale_application_access.reviewer_roles(); a dedicated Sale-manager role may replace it later (GAP-1930)
S-05sale_application.submitAPP_SALEany_memberSELFPROPOSEDP1-12: SA-01 Rule 1/AC03/AC08 the direct applicant (APP_SALE member still PENDING, no role) submits on the Sale App; catalog submitSaleApplication; SQL also requires an ACTIVE account and a PENDING membership (GAP-17)
S-06sale_application.readAPP_SALEany_memberSELFPROPOSEDP1-12: SA-01 Rule 1/AC07 applicants view their status and public rejection reason (S-07 frames); catalog saleApplication; own row only (GAP-17)
U-09sale_application.submitAPP_USERuserOWNPROPOSEDP1-12: UA-26 Rule 1/AC03/AC04 a User applies to become a Sale; server Mission check (MT-01) before create; catalog submitSaleApplication
U-10sale_application.readAPP_USERuserOWNPROPOSEDP1-12: UA-26 Rule 2/AC05/AC08 status and rejection reason of the own application only; catalog saleApplication

deal ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
O-03deal.manageWEB_ADMINoperations adminALLPROPOSEDPD-08 s15 (GAP-01); DEC-OPS-SCOPE decided 2026-10-06 (owner-questions-2026-10-06 OQ-46, extends owner answer #52): Operations holds ALL scope for deal.manage (campaign commands; FU-OPSSCOPE, GAP-26/GAP-43) FU-OPSGRANTS DEC-OPS-ADMIN-ALL decided 2026-10-07: admin also holds deal.manage at ALL (GAP-1920 resolved).
OPS-01deal.readWEB_ADMINoperations adminALLPROPOSEDFU-OPSSCOPE; DEC-OPS-SCOPE decided 2026-10-06: Operations reads campaigns at ALL (campaigns, campaign: the read guard key of the P2-07 API, previously NO_RULE, GAP-43; P5-A14..A19 pages). Admin is not granted (the decision grants Operations only) FU-OPSGRANTS DEC-OPS-ADMIN-ALL decided 2026-10-07: admin also reads campaigns at ALL (GAP-1920 resolved; replaces "Admin is not granted").
PUB-01deal.read_publicAPP_USERanonymousPUBLICPROPOSEDP2-08 publicCampaigns/publicCampaign/campaignProgress: published Group Buy only. UA-04 Precondition 'guests may explore' + AC07 'Guest ... do not force sign-in before viewing public content', UA-06 Precondition 'sign-in is not required to view it' + AC07, UA-07 Precondition 'offer ... is public', UA-01 Rule 2 'public content remains viewable without signing in', 21-user-app-approved-ui UA-UI-01 HC01 'public offers are readable without login'. Scope PUBLIC like A-04: any caller in APP_USER (no membership/role needed; no grant seeded). SQL mirror campaign.public_reader(). Token-less transport: GAP-55; closed-campaign progress: GAP-56. #286: also publicRecurringCampaigns/publicRecurringCampaign (published Recurring only), SQL mirror campaign.public_recurring_reader() (APP_USER only) | G1S (#407): also publicCategories (S15), publicSaleCompanion (S16, R9: the public card of the ACTIVE Sale owning a valid link code), publicSearch / publicSearchFacets (S20/S21, published Group Buy Deals and Recurring products, Dang mo / Sap mo ban only) | G2S (#422): also publicRecurringQuote (S12, DR-09: the guest quote of a published OPEN Recurring basket from the device basket; no Pi-Point, address, referrer or server basket; nothing persisted).
PUB-02deal.read_publicAPP_SALEsaleALLPROPOSEDFU-525 (owner decision 2026-10-06 on GAP-525, recorded by P5-S07): the Sale reads PUBLISHED campaigns to pick a destination to share; same queries and same data as PUB-01 (publicCampaigns/publicCampaign/campaignProgress: published Group Buy only, allow-listed public projection; never a deposit amount, a quote or buyer data). SA-03 Precondition 'The Salesperson is Active and authorized to share; the destination ... Campaign still exists and is public'. NOT scope PUBLIC: the evaluator admits every caller of the app under a PUBLIC rule, which would admit a PENDING, rejected or locked Sale, so this rule is held through the sale role grant (ACTIVE account + ACTIVE APP_SALE membership + live grant); scope ALL because there is no row owner (the published filter lives in the SQL projection, not in the row scope). Grant seeded by the forward migration 20261011010000. SQL mirror campaign.public_reader(). WEB_ADMIN keeps no rule (NO_RULE). #286: the two Recurring reads pass this guard but campaign.public_recurring_reader() answers nothing for APP_SALE (owner 2026-10-15: App Sale pending), so Recurring stays invisible to a Sale | G1S (#407): the four new public reads (publicCategories, publicSaleCompanion, publicSearch, publicSearchFacets) pass this guard too; Sale App development is stopped (owner 26/10), no Sale screen uses them. G2S (#422): publicRecurringQuote passes this guard too but answers not_found for APP_SALE (campaign.public_recurring_reader(), like the other Recurring reads).

finance_policy ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
FPL-01finance_policy.readWEB_ADMINALLGAPP3-07; list/detail of Finance policy versions (funds/vouchers, refund thresholds, tolerance; ADR-0004, G-FIN). No story names who reads them (GAP-71)
FPL-02finance_policy.writeWEB_ADMINALLGAPP3-07; saveFinancePolicyDraft (UNDECIDED/INTERIM draft, never APPROVED). No story names who records a Finance policy version (GAP-71)
FPL-03finance_policy.submitWEB_ADMINALLmaker, mfaGAPP3-07; submitFinancePolicyVersion (maker). ADR-0004 maker != checker; DEC-FIN-* owners Finance/BO not mapped to a role (GAP-71)
FPL-04finance_policy.approveWEB_ADMINALLchecker, mfaGAPP3-07; approveFinancePolicyVersion (checker, never author/editor/maker; APPROVED is immutable). Approver of a G-FIN decision record unsourced (GAP-71)

mission ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
MS-01mission.readWEB_ADMINsale_managerALLPROPOSEDP4-02; A-MIS-03 'As a Sale Manager, I want to view, filter, and deactivate Missions', Precondition 'permission to view Missions'; catalog missions/mission; registry loyalty.json mission_definitions PERM_GATED mission.read. Mission configuration rows carry no team, so scope ALL (GAP-45)
MS-02mission.writeWEB_ADMINsale_managerALLPROPOSEDP4-02; A-MIS-01/A-MIS-02 'As a Sale Manager, I want to create a Mission / define the conditions' (save version AC03/AC06, publish AC07), A-MIS-03 AC06 stale edit; catalog saveMissionDraft/publishMission; registry loyalty.json PERM_GATED mission.write (GAP-45)
MS-03mission.pauseWEB_ADMINsale_managerALLPROPOSEDP4-02; A-MIS-03 Sale Manager deactivates with an impact preview (AC02/AC03); Precondition 'edit and deactivate permissions are separate'; catalog pauseMission; permission name not in PD-08 s15 (GAP-05, GAP-45)
MS-04mission.assignWEB_ADMINALLGAPP4-02; catalog assignMission; MT-01 window starts at assignment; no story names who assigns a Mission to a member (A-MIS-01..04 cover configure, list/deactivate and progress) (GAP-45)

payment ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
F-01payment.readWEB_ADMINfinanceALLpii:maskedPROPOSEDPD-08 s14 Finance financial scope (GAP-02)
ORD-04payment.method_selectAPP_USERuserOWNDEFINEDB269.R07 (NFR6). U19-P0-04 (Word v2 Đơn hàng/Vận đơn, NFR #6 B269.R07: xem, hủy đơn, xử lý hoàn tiền, tạo vận đơn, cập nhật vận chuyển là các quyền tách riêng). Interim role mapping operations + admin ALL (the Phân quyền module owns the detailed design). Seeded by 20261223000000 § permissions_word_v2. The buyer selects the remaining payment method of an OWN order: selectRemainingPaymentMethod.
U-04payment.readAPP_USERuserOWNDEFINEDPD-08 s15; catalog paymentStatus
U-05payment.startAPP_USERuserOWNPROPOSEDcatalog startDepositPayment/startRemainingPayment/selectCod | G1S (#407, S23, GAP-G1S-04 = (a)): mutation dropOrderPoints (U-30b, own Group Buy order waiting for its deposit, no point hold) rides on this rule like startDepositCheckout; no new rule, no grant change. | #479 T14: cancelPaymentSession (the buyer closes the provider session of its own open payment attempt) rides on this rule; no new rule, no grant change.

privacy_request ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
PRV-01privacy_request.readAPP_USERuserOWNPROPOSEDP1-14; catalog privacyRequests; A-SEC-05/06 the subject follows its own export/deletion request; PD-08 s29 access/export and deletion workflows; own rows only (GAP-59)
PRV-05privacy.reviewWEB_ADMINALLGAPP1-14; A-SEC-05 Privacy Operator intake queue (AD-CUST-07); privacyRequests for staff; 'Privacy Operator' is not a PD-08 s14 role (GAP-59); SQL privacy.reviewer_roles() empty
PRV-06privacy.reviewWEB_ADMINALLmfa, không tự làmGAPP1-14; catalog reviewPrivacyRequest; A-SEC-05 verify/approve, PD-08 s19 bulk export/anonymisation maker != checker (Ops/Privacy maker, Privacy/Data Owner checker); reviewer role unmapped (GAP-59); SQL refuses a self-review regardless
U-08privacy_request.createAPP_USERuserOWNPROPOSEDcatalog requestPrivacyExport; P1-14
MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ATR-01referral_link.createAPP_USERuserOWNPROPOSEDP4-11; UA-27 'invite new users to sign up through my personal link' and UA-35 'Create link' (User owner + tracking code); catalog createReferralLink/createAffiliateLink; S-04 is the Sale twin; permission name not in PD-08 s15 (GAP-05, GAP-57)
ATR-03referral_link.readAPP_USER, APP_SALEuser saleOWNPROPOSEDP4-11; UA-27 'Personal link: read-only/copy', SA-13 Rule 2 'the Salesperson can view their link/validity'; catalog referralLink/affiliateLinks; permission name not in PD-08 s15 (GAP-05, GAP-57)
ATR-05referral_link.openAPP_USERanonymousPUBLICPROPOSEDP4-12; UA-27 Rule 1 'the link ... opens the correct sign-up flow' + AC03 'Guest opens Referral link' + AC06 'Fake/invalid link: safe sign-up flow; do not assign a fake owner', SA-13 AC06, UA-35 Rule 2 'records Last-Touch when the customer opens the link' + AC06 closed Campaign; mutation openAttributionLink (records the open, returns only an allow-listed in-app target kind, never owner data). Scope PUBLIC like PUB-01: any caller in APP_USER, no grant seeded; SQL mirror attribution.open_link() (claimed app APP_USER). Token-less transport: GAP-55; cross-device/app-install persistence: GAP-85
S-04referral_link.createAPP_SALEsaleOWNPROPOSEDcatalog createReferralLink/createAffiliateLink

refund ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
FRM-02refund.readWEB_ADMINfinance_managerALLPROPOSEDFU-REFTHR; the Finance Manager reads the refund case being decided (queries refundCase / refundCases; SQL payment.refund_reader_roles()); nothing else of Finance is granted (GAP-1341)
ORD-03refund.submitAPP_USERuserOWNDEFINEDB269.R07 (NFR6). U19-P0-04 (Word v2 Đơn hàng/Vận đơn, NFR #6 B269.R07: xem, hủy đơn, xử lý hoàn tiền, tạo vận đơn, cập nhật vận chuyển là các quyền tách riêng). Interim role mapping operations + admin ALL (the Phân quyền module owns the detailed design). Seeded by 20261223000000 § permissions_word_v2. The buyer submits the refund account of an OWN order: submitRefundRequest.
RFD-01refund.readWEB_ADMINfinanceALLPROPOSEDP3-10; PD-08 s14 Finance = Payment/refund/reconciliation; PAY-R1-06 actor 'Finance checker'; registry refund_cases OWN_ROW owner read + Finance; queries refundCase / refundCases; SQL payment.refund_reader_roles() (GAP-117)
RFD-02refund.recoverWEB_ADMINfinanceALLmfaPROPOSEDP3-10; PAY-R1-06 'Compensation: unknown/retry/evidence/approval' + 'UNKNOWN lookup before retry'; mutation retryRefundBranch recovers a REJECTED leg; SQL payment.refund_recover_roles() (GAP-117)

report ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
B-01report.readWEB_ADMINbi_viewer marketingALLpii:maskedDEFINEDPD-08 s14 dataset scope, aggregated/masked default
M-03report.readWEB_ADMINsale_managerTEAMpii:masked, snapshotPROPOSEDA-REP-03; A-TEAM-02 EC04 history unchanged; transfer policy open GAP-04
RPT-01report.readWEB_ADMINfinanceALLpii:maskedPROPOSEDP4-20; A-REP-04/05/06 actors are Operations and Finance ('Report read access is scoped; money/PII/export require separate permissions'); gates the non-money report reads reportCampaignFunnel, reportCampaignCohort, reportPoints and reportSalePerformance (ALL) for Finance, next to the DEFINED B-01 grant of bi_viewer / marketing and the M-03 TEAM grant of sale_manager; SQL mirror report.access('READ' | 'SALE') = the live report.read grant at ALL; Operations has no grant (scope GAP-01); role mapping GAP-02, permission name already in PD-08 s14 (GAP-199, GAP-200)
RPT-03report.exportWEB_ADMINfinanceALLpii:maskedPROPOSEDP4-21; A-REP-02 'export report data to share with authorized people' (Rule 2: PII/Finance only with separate permission, audited, rechecked at download), A-REP-06 'Finance report read/export'; gates requestReportExport / retryReportExport / reportExports / reportExport / downloadReportExport for the non-money reports (CAMPAIGN_FUNNEL, CAMPAIGN_COHORT, POINTS, SALE_PERFORMANCE); the actor also needs the matching read grant (report.read), checked again by SQL report_export.permit; Operations (A-REP-02 actor, scope GAP-01), bi_viewer, marketing and sale_manager TEAM have no export grant (GAP-245)

spin ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
SPN-01spin.readAPP_USERuserOWNPROPOSEDP4-15; UA-30 'Session: Order/session ID/state', UA-31 total/remaining, UA-32 spin history + highest; the buyer reads only their own session (one per own order); query mySpinSessions; registry loyalty.json spin_sessions OWN_ROW; permission string not in PD-08 s15 (GAP-05, GAP-68)
SPN-02spin.readWEB_ADMINoperations adminALLPROPOSEDP4-15; A-SPIN-01/02 config review and P5-A34 session/result audit (AD-SPIN-01..03); spinRuleInForce / spinRuleDraft (GAP-342); owner D6 2026-10-22: the 'Category/Supply Manager' is operations + admin (GAP-26 / DEC-OPS-SCOPE); SQL spin.manager_roles() = {operations,admin}; seeded by 20261225020000 (GAP-67 resolved)
SPN-03spin.writeWEB_ADMINoperations adminALLPROPOSEDP4-15; A-SPIN-01 'As a Category/Supply Manager, I want to set the number of spins', A-SPIN-02 point tiers/probabilities; saveSpinRuleDraft/publishSpinRule (catalog names none: GAP:admin-spin-rule-op-absent); registry loyalty.json PERM_GATED spin.write; owner D6 2026-10-22: operations + admin, single-actor versioned audited publish, risk NORMAL; seeded by 20261225020000 (GAP-67 resolved)
SPN-04spin.playAPP_USERuserOWNPROPOSEDP4-16; UA-30 'tap Spin -> receive server result', UA-31 AC03 (one spin left, two requests -> at most one), UA-32 (every spin saved, one reward = the highest); mutation drawSpin (catalog drawSpin); the buyer spins only their own session (SQL spin.play() re-checks owner + ordering.is_buyer(); a foreign or unknown session is not_found); permission string not in PD-08 s15 (GAP-05, GAP-127) | G1S (#407, S10, DEC-OWN27-SPIN-SESSION): mutation resumeSpinSession (own KEPT session, new window before the campaign close) rides on this rule; no new rule. | #412 (GAP-671, U-42): mutation leaveSpinSession (own session, leave = end now by BR-APP-10) rides on this rule; no new rule. | VQM-P0-03 (#491, S10, BR-VQ-08): mutations enterSpinSession (enter the Vòng quay screen; the first entry starts the session) and spinSessionHeartbeat (liveness of the open screen) on the caller's own session ride on this rule; no new rule.

voucher ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
VCH-01voucher.readWEB_ADMINfinanceALLPROPOSEDP3-09; A-CASH-01 'Finance & Accounting views the cashbook' + AC01 draft vouchers listed without effect; PAY-R1-03 (list/open vouchers, evidence and approval trail); PD-08 s14 Finance = Payment/refund/reconciliation; registry vouchers PERM_GATED. Name not in PD-08 s15 (GAP-115)
VCH-02voucher.draftWEB_ADMINfinanceALLPROPOSEDP3-09; A-CASH-02/03 actor 'Finance & Accounting' creates a receipt/payment voucher; PAY-R1-03 main flow 1 'Lap DRAFT' (maker edits a draft = new version, ALT01) and the reversal draft; saveVoucherDraft, cancelVoucher (own draft only). Whether Finance may also prepare for approval is VCH-03 (GAP-115)
VCH-03voucher.submitWEB_ADMINfinanceALLmaker, mfaPROPOSEDP3-09 + FU-713; DEC-FIN-FUNDS decided 2026-10-05 (owner-questions #42): Finance staff prepare manual vouchers (PAY-R1-03 'Ke toan maker'); the FUNDS_VOUCHER policy version in force still names makerRoles per fund/kind (supabase/ops/seed-funds-voucher.sql) and without it submitVoucher answers policy_undecided. submitVoucher (GAP-1542)
VCH-04voucher.approveWEB_ADMINfinanceALLchecker, mfaPROPOSEDP3-09 + FU-713; DEC-FIN-FUNDS decided 2026-10-05: a Finance approver who is not the maker approves with MFA (PAY-R1-03 step 3 independent checker approves payload/version, EC01 maker self-approval denied, EC02 stale; PD-08 s19 maker != checker, by account identity); checkerRoles per fund/kind come from the FUNDS_VOUCHER policy in force. approveVoucher and rejectVoucher (the checker sends a submitted voucher back with a reason) share this rule (GAP-1542)

application_document ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
MD-09application_document.uploadAPP_SALEany_memberSELFPROPOSEDDEC-S-APPLICATION-UPLOAD (interim assumption 2026-10-07, GAP-22, FU-PENDINGUPLOAD): a signed-in APP_SALE account whose membership is PENDING (no role) uploads (createMediaUpload/completeMediaUpload) its OWN SUPPORTING_DOCUMENT media for its Sale application only; the API guard picks this resource only for a PENDING membership (a REJECTED, SUSPENDED or LOCKED one falls to MD-01..03 and is denied), the service allows no other purpose and caps the account at 10 not-deleted objects (GAP-2030), SQL mirror sale_application_access.is_pending_applicant()/applicant_document_room() on 20261124010000; no grant row (any member, SELF, like S-05)
MD-10application_document.readAPP_SALEany_memberSELFPROPOSEDDEC-S-APPLICATION-UPLOAD (interim assumption 2026-10-07, GAP-22, FU-PENDINGUPLOAD): a signed-in APP_SALE account whose membership is PENDING (no role) reads (media/mediaSignedView) its OWN SUPPORTING_DOCUMENT media for its Sale application only; the API guard picks this resource only for a PENDING membership (a REJECTED, SUSPENDED or LOCKED one falls to MD-01..03 and is denied), the service allows no other purpose and caps the account at 10 not-deleted objects (GAP-2030), SQL mirror sale_application_access.is_pending_applicant()/applicant_document_room() on 20261124010000; no grant row (any member, SELF, like S-05)
MD-11application_document.deleteAPP_SALEany_memberSELFPROPOSEDDEC-S-APPLICATION-UPLOAD (interim assumption 2026-10-07, GAP-22, FU-PENDINGUPLOAD): a signed-in APP_SALE account whose membership is PENDING (no role) deletes (deleteMedia, soft delete) its OWN SUPPORTING_DOCUMENT media for its Sale application only; the API guard picks this resource only for a PENDING membership (a REJECTED, SUSPENDED or LOCKED one falls to MD-01..03 and is denied), the service allows no other purpose and caps the account at 10 not-deleted objects (GAP-2030), SQL mirror sale_application_access.is_pending_applicant()/applicant_document_room() on 20261124010000; no grant row (any member, SELF, like S-05)

auth ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
A-01auth.registerAPP_USER, APP_SALEanonymousPUBLICDEFINEDAUTH-01; 03-authentication s2; WEB_ADMIN off (DEC-PPI-D-17, PPI-P2-05: an Admin creates staff accounts)
A-02auth.sign_inAPP_USER, APP_SALE, WEB_ADMINanonymousPUBLICDEFINEDAUTH-01; s3
A-03auth.password_resetAPP_USER, APP_SALEanonymousPUBLICDEFINEDAUTH-01; s4; WEB_ADMIN off (DEC-PPI-D-17, PPI-P2-05: an Admin issues a temporary password)

catalog ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
CAT-01catalog.readWEB_ADMINoperations adminALLPROPOSEDP2-01; 2-product-management NH-US-01/TH-US-01 actor Category/Supply Manager (Admin with Category/Brand Management permission); domain model Category/Brand owner Category/Ops, PM-BP-05 Category/Admin; registry catalog.json; catalog rows have no owner/team so scope ALL; role mapping GAP-19; U12 (G-UNIT, G-HISTORY, 2026-10-12, no new permission): productUnits, productUnitOptions, productUnitNameAvailability, productUnitUnmatched, productColumnPreference, productHistory, productHistoryRecent, productHistoryActors; PSW (Word 23/10, owner Q6 2026-10-26, no new permission): productAttributes, productAttribute, and the new Product / ProductUnit fields (shortName, shortDescription, isGenuine, accessories, specs; baseUnit, factor, forSale, usage)
CAT-02catalog.writeWEB_ADMINoperations adminALLPROPOSEDP2-01; NH-US-02..04, TH-US-02..04 saveCategory/deleteCategory/saveBrand/deleteBrand; registry catalog.json writes PERM_GATED catalog.write; role mapping GAP-19; U12 (G-UNIT, G-RESTORE, 2026-10-12, no new permission): saveProductUnit, setProductUnitStatus, deleteProductUnit, and the Delete permission also gates deletedProducts, restoreProduct, bulkRestoreProducts; PSW (Word 23/10, owner Q6 2026-10-26, no new permission): createProductAttribute, updateProductAttribute, reorderProductAttributes, deleteProductAttribute, addProductAttributeOption, updateProductAttributeOption, reorderProductAttributeOptions, setProductAttributeOptionStatus, deleteProductAttributeOption, moveProductAttribute, mergeProductAttribute, and the write helpers productAttributeNameSuggestions, previewProductAttributeMerge, categoryDeletePreview
CAT-03catalog.readWEB_ADMINsuper_adminALLPROPOSEDU12-FU-60 (owner answer 2026-10-13, SA-CATALOG-READ): super_admin views products and the product change history (catalog.read only; no CAT-02 catalog.write). Its own row like FRM-01: CAT-01 keeps operations and admin, the list catalog.manager_roles() mirrors for writes (GAP-19); the database read gate follows the catalog.read permission (U12-FU-58, GAP-2303). As a catalog.read holder super_admin also passes every CAT-01 guard (lists, units, column preference, exportProducts). Seed 20261213030000_history_export_permissions.sql.

cms ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
CMS-01cms.readWEB_ADMINALLGAPP4-17; A-CMS-03 AC09 / A-CMS-05..07 name separate read/create/update/publish/delete permissions and a read-only CMS user, but no role is sourced for read-only CMS access (GAP-61). Not used by any guard: CMS reads use MK-01 cms.manage; SQL cms.actor_can('read') = MK-01 or MK-02 roles.
MK-01cms.manageWEB_ADMINmarketingALLDEFINEDPD-08 s14/s15 Marketing CMS
MK-02cms.publishWEB_ADMINmarketingALLPROPOSEDPD-08 s15; publisher role not specified (GAP-02)

point_adjust ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ADJ-01point_adjust.readWEB_ADMINoperations financeALLPROPOSEDP3-21; the maker (operations, F-06) and the checker (finance, F-07) read the ADJUST proposals and their delivery state (queries pointAdjustments, pointAdjustment) and the rank-only debits (PPI-P5-07 rankAdjustments, rankAdjustment), the point commands PIDEAL sent to PiPoint (PPI-P8-01 pointRequests, pointRequest) and one customer's PiPoint wallet history (PPI-P8-02 customerPointHistory; DEC-PPI-OWN04-POINT-HISTORY-READ, no new permission): roles derived from DEC-PPI-GAP-06b and the P3-21 read = maker or checker rule. Permission name not in PD-08 s15 (GAP-05)
F-06point_adjust.requestWEB_ADMINoperationsALLmaker, mfaPROPOSEDDEC-PPI-GAP-06b (owner 2026-11-02, GAP-PPI-06/06b = a): operations requests EVERY ADJUST slip and the rank-only debit (PPI-P5-07 requestRankDebit); replaces the PRD AP-09 Finance-owns-Pi-Point reading. Catalog requestPointAdjust (P3-21: MFA step-up; the proposal needs a wallet link, READY private evidence, a reason and an approved rate snapshot)
F-07point_adjust.approveWEB_ADMINfinanceALLchecker, mfaPROPOSEDmaker-checker mandatory (PD-08 s19, baseline); checker = finance by DEC-PPI-GAP-06b (owner 2026-11-02, GAP-PPI-06/06b = a; closes GAP-08). P3-21: approvePointAdjust and rejectPointAdjust, PPI-P5-07: approveRankDebit and rejectRankDebit all ride on this rule (a decision binds the version and payload hash; the maker never decides, also via a second role)

point_config ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ADT-02point_config.readWEB_ADMINfinance business_ownerALLPROPOSEDP4-08; A-CFG-02/03 reads the current global point cap / rate / Tier benefit policy version and history (pointConfigVersions); FU-BIZOWNER DEC-POINT-APPROVER (decided 2026-10-06): the maker (finance) and the checker (business_owner) read; SQL mirrors campaign.point_config_maker_roles() = finance / point_config_checker_roles() = business_owner (GAP-65, GAP-445 closed)
ADT-03point_config.proposeWEB_ADMINfinanceALLmaker, mfaPROPOSEDP4-08; A-CFG-02/03 maker proposes or edits an open cap / rate / Tier benefit policy version (savePointConfigVersion); FU-BIZOWNER DEC-POINT-APPROVER (decided 2026-10-06): Finance prepares, MFA step-up (GAP-65, GAP-445 closed)
ADT-04point_config.decideWEB_ADMINbusiness_ownerALLchecker, mfaPROPOSEDP4-08; A-CFG-02/03 a different checker approves or rejects the unchanged payload (decidePointConfigVersion) of a POINT_CAP / POINT_RATE / TIER_BENEFIT_POLICY version; maker != checker also enforced in SQL; FU-BIZOWNER DEC-POINT-APPROVER (decided 2026-10-06): the new role business_owner approves, MFA step-up (GAP-65, GAP-445 closed)

role ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
RB-01role_permission.manageWEB_ADMINadminALLPROPOSEDP1-06; A-RBAC-01..03 role list/detail/history, permission catalog, change queue; PD-08 s14 Admin role assignment per permission
RB-02role_permission.approveWEB_ADMINsuper_adminALLPROPOSEDP1-06; A-SEC-07 checker reviews the exact before/after; PD-08 s19 checker Super Admin
RB-03role_permission.manageWEB_ADMINadminALLmfaPROPOSEDP1-06; A-RBAC-01 create/edit custom WEB_ADMIN role name/description (grants nothing, AC06); PD-08 s18 role_permission.manage is privileged -> MFA. Grant sets, assignments and revocations use AD-01/AD-02 (GAP-28)

sale ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
SAL-01sale.readWEB_ADMINadmin super_admin operations sale_managerALLpii:maskedPROPOSEDFU-L4-SALE-READ; DEC-R1-UNBUILT-AC (owner 2026-10-07: Operations must find and open a Sale); AP-16 Sale list and AP-17 Sale detail with its Referral and Affiliate tabs (queries saleMembers, saleMemberDetail, saleReferrals, saleAffiliateOrders; GAP-215). Roles: admin and super_admin are the Sale reviewers (AD-07/AD-08, DEC-S-APPLICATION-REVIEWER) and operations holds ALL over Sale matters in the owner's interim scope (DEC-OPS-SCOPE, DEC-OPS-ADMIN-ALL, GAP-2015); sale_manager keeps M-05 at TEAM and gets no ALL read (GAP-2133). PII stays MASKED in the database (customer.mask_phone, no customer.pii.read, O-05). Grant seeded by 20261130010000 (-- rbac-forward-grants); SQL mirror sale_admin.reader_roles() / actor_can_read() | U6-P2-22 (final 04-quan-ly-sale.md, contract-freeze s7, X-06): sale_manager added at ALL (supersedes GAP-2133 for sale.read); phone FULL only when the caller also holds SAL-02. Seed 20261211030300.
SAL-02sale.manageWEB_ADMINadmin super_admin sale_managerALLPROPOSEDU6-P2-22 (final 04-quan-ly-sale.md 'quyen Quan ly sale', SL-US-01..03; contract-freeze s7, X-06, INT-SL-03/05): createSale, updateSale, setSaleAccountStatus, saleTierOptions; PII FULL; replaces the TEAM-scoped M-05 for the PRD flows only. Seed 20261211030300; SQL mirror sale_admin.manager_roles()/actor_can_manage()
SAL-03sale.reviewWEB_ADMINadmin super_adminALLmfa, không tự làmPROPOSEDU6-P2-22 (final 04-quan-ly-sale.md SL-US-04 'quyen phe duyet/tu choi' PRD:396; contract-freeze s7, X-06, K-10, DEC-S-APPLICATION-REVIEWER): approveSaleTicket, rejectSaleTicket (GATED GAP-02), saleRejectionReasons; reviewer is never the Sale nor the Admin who created it (SQL). Seed 20261211030300; SQL mirror sale_admin.reviewer_roles()/actor_can_review()

shipment ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
SHP-01shipment.readWEB_ADMINoperations adminALLDEFINEDB269.R07 (NFR6); WP-VD-11. U19-P0-04 (Word v2 Đơn hàng/Vận đơn, NFR #6 B269.R07: xem, hủy đơn, xử lý hoàn tiền, tạo vận đơn, cập nhật vận chuyển là các quyền tách riêng). Interim role mapping operations + admin ALL (the Phân quyền module owns the detailed design). Seeded by 20261223000000 § permissions_word_v2. Shipment list and tab counts (U19-P2-27), step 1 order/cycle pick (U19-P2-28), shipment detail (U19-P2-34), the Giao hàng block of the order detail. requireShipment(ctx, read) also accepts OPS-02 order.read until U19-P4-02.
SHP-02shipment.createWEB_ADMINoperations adminALLDEFINEDB269.R07 (NFR6); B162.R02; WP-VD-11. U19-P0-04 (Word v2 Đơn hàng/Vận đơn, NFR #6 B269.R07: xem, hủy đơn, xử lý hoàn tiền, tạo vận đơn, cập nhật vận chuyển là các quyền tách riêng). Interim role mapping operations + admin ALL (the Phân quyền module owns the detailed design). Seeded by 20261223000000 § permissions_word_v2. Step 2, createShipment, handover (U19-P2-22, U19-P2-29). requireShipment(ctx, create) also accepts O-02 order.manage until U19-P4-02.
SHP-03shipment.updateWEB_ADMINoperations adminALLDEFINEDB269.R07 (NFR6); WP-VD-11. U19-P0-04 (Word v2 Đơn hàng/Vận đơn, NFR #6 B269.R07: xem, hủy đơn, xử lý hoàn tiền, tạo vận đơn, cập nhật vận chuyển là các quyền tách riêng). Interim role mapping operations + admin ALL (the Phân quyền module owns the detailed design). Seeded by 20261223000000 § permissions_word_v2. updateShipmentStatus (U19-P2-26) and the order detail button Cập nhật vận chuyển (U19-P3-09/P3-10). requireShipment(ctx, update) also accepts O-02 order.manage until U19-P4-02. The COD collector role list is unchanged (U19-P2-31).

staff ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
AD-05staff.readWEB_ADMINadmin super_adminALLpii:maskedPROPOSEDcatalog staff/staffDetail; PD-08 s14 Admin ALL per permission
AD-09staff.createWEB_ADMINadmin super_adminALLmfaPROPOSEDPPI-P0-04 (#428, round 2026-10-26-pipoint-integration 03 §3.1; D-14, E-05): createStaffAccount always creates a NEW STAFF account (never attached to a customer/Sale account of the same phone), WEB_ADMIN membership ACTIVE at once (PPI-P7-01, DEC-PPI-OWN03-STAFF-ADD-FLOW; was PENDING) and a role change request with maker = caller, approved by someone else under AD-02; admin and super_admin with MFA step-up (step-up action staff.create); only super_admin may request super_admin and the last-super-admin rule holds (SQL identity.staff_provision, PPI-P2-04); the staffAccounts list reads under AD-05 staff.read; seeded by PPI-P2-04 (migration 20261230051200, -- rbac-forward-grants), the step-up action staff.create is this rule
AD-10staff.credential_issueWEB_ADMINadmin super_adminALLmfa, không tự làmPROPOSEDPPI-P0-04 (#428, 03 §3.2; D-15, D-17): POST auth/staff/temporary-password (auth function, not GraphQL) issues a one-time temporary password (72 h, must_change) to an ACTIVE staff member (PPI-P7-01: a role is no longer required; the creator's first password right after createStaffAccount rides on the staff.create step-up of that create); caller != target, checked and the step-up grant staff.credential_issue spent inside identity_flow.staff_credential_issue (rbac.actor_holds); also the staff 'forgot password' path (no OTP for WEB_ADMIN, D-17); seeded by PPI-P2-04 (migration 20261230051200, -- rbac-forward-grants), the step-up action staff.credential_issue is this rule

tier ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ADT-01tier.writeWEB_ADMINsale_managerALLmfaPROPOSEDP4-08; A-TIER-01 'As a Sale Manager, I want to configure Tiers and benefits by role' (name, order, rank threshold, required Missions, multipliers; save/publish a version, AC07 stale edit conflict); saveTierVersion / publishTierVersion (catalog saveTierVersion); Tier rows carry no team so scope ALL; SQL mirror tier.writer_roles() / tier.actor_can('write'); permission name not in PD-08 s15 (GAP-05); the A-TIER-02 member list and Tier list reuse TIR-02 tier.read (GAP-103, GAP-124); FU-TIERAPPROVE (DEC-POINT-TIER-APPROVAL, superseded in part by DEC-U28-05): tier.write was the PROPOSER right of a multiplier change, with a business_owner approval (ADT-06) before a changed multiplier could be published; that gate and its proposal flow are gone; U28-P0-03 DEC-U28-05 (2026-10-28, Word HT-v1 B011.R15/R18): direct save, tier.write is Tạo/Sửa/Xóa of the customer Tier set and N (createMembershipTier, updateMembershipTier, deleteMembershipTier, updateRankPointPolicy) with MFA step-up (mfa true), proposeTierMultiplierChange / decideTierMultiplierChange removed (ADT-06 kept without a field); tier.read TIR-02 reads the set and the customer tab
TIR-01tier.readAPP_USER, APP_SALEuser saleOWNPROPOSEDP4-07; UA Membership tier 'show Standard by default, current tier, valid/expiring rank points, next tier requirements' + AC02 multiple rank lots + AC03 redeeming does not reduce rank, SA-09 'current Tier and valid/expiring rank points, tier assignment history', A-TIER-03 AC07 'a lot is about to expire: display the correct amount/date'; catalog myTier/rankLots, myTierHistory added by P4-07; SQL mirror tier.actor_is_member(); permission name not in PD-08 s15 (GAP-05)
TIR-02tier.readWEB_ADMINsale_managerALLPROPOSEDP4-07; A-TIER-02 'As a Sale Manager, I want to view Users/Sales in each Tier... open Tier change history and the system/adjustment reason' (current Tier, active rank, assignment time, evidence and policy); memberTier/memberRankLots/memberTierHistory added by P4-07 (the member list tierMembers is P4-08); Tier rows carry no team, so scope ALL; SQL mirror tier.actor_can_read() / tier.reader_roles(); permission name not in PD-08 s15 (GAP-05)

attribution ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ATR-02attribution.readAPP_USERuserOWNpii:maskedPROPOSEDP4-11; UA-36 'view customers who purchased through my link' (masked name/ID) + AC08 another owner blocked, UA-28 AC06; catalog attribution; S-03 is the Sale twin (GAP-57)
S-03attribution.readAPP_SALEsaleOWNpii:maskedPROPOSEDcatalog attribution/saleCustomers; PII masking

catalog_media ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
MD-12catalog_media.uploadWEB_ADMINoperations adminOWNPROPOSEDU6-P3-38 (contract freeze s7, X-03, K-11, K-19; media-delta s6): PRODUCT_IMAGE upload (product gallery, category image, brand logo; PRD 01:793, 02:514, 03:426) by the CAT-02 roles; seed 20261211090200
MD-13catalog_media.deleteWEB_ADMINoperations adminOWNPROPOSEDU6-P3-38 (contract freeze s7, X-03, K-11, K-19; media-delta s6): soft delete of the caller's own PRODUCT_IMAGE media by the CAT-02 roles; seed 20261211090200

cod ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
COD-01cod.collectWEB_ADMINoperations adminALLPROPOSEDP3-06; A-FF-03 Rule 2 'Changing COD status to collected requires confirmation of collection evidence', A-OPS-04 'confirming COD collection ... requires the corresponding permissions' (actor Operations Manager); catalog recordCodCollection; registry cod_collections PERM_GATED cod.collect. Operations scope is GAP-01, so nobody records a COD collection by hand (GAP-77); the shipment's carrier (assigned collector) reports through the verified system path FU-OPSGRANTS DEC-OPS-COD-COLLECT decided 2026-10-07 (owner message): operations and admin record a COD collection by hand at ALL (GAP-1922 resolved); maker/checker rules F-02..F-07 untouched; interim until the detailed role design (GAP-2015)
COD-02cod.remitWEB_ADMINfinanceALLPROPOSEDP3-06; execution/03-money-points 'REMITTED is later bank/partner evidence', PAY-R1-05 step 4 'giu remittance la thong tin rieng', BL-14 'Finance xac nhan cach ghi quy', PD-08 s14 Finance = Payment/refund/reconciliation; catalog recordCodRemittance; registry cod_remittances PERM_GATED cod.remit. Name/role need ARCH/Finance confirmation (GAP-05, GAP-77)
MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
PRV-02consent.readAPP_USER, APP_SALEuser saleOWNPROPOSEDP1-14; NFR-PRI-002 consent traced per terms version, NFR-CPL-004 provable; 9-user-app Terms row; operation myConsents not in the catalog (GAP-60)
PRV-03consent.manageAPP_USER, APP_SALEuser saleOWNPROPOSEDP1-14; NFR-PRI-002; PD-08 s30 Collect consent/notice; 15-admin AP-32 EC06 marketing opt-out; grantConsent/withdrawConsent not in the catalog (GAP-60)

customer_group ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
OPS-04customer_group.readWEB_ADMINoperations adminALLPROPOSEDFU-OPSGRANTS DEC-OPS-CUSTOMER-READ decided 2026-10-07 (owner message): temporarily operations and admin have full rights on the customer admin area at ALL (GAP-25 resolved for these keys, GAP-2015 interim until the detailed role design); customerGroups (NKH-US-01..03; web customer groups page and the group picker)
OPS-05customer_group.writeWEB_ADMINoperations adminALLPROPOSEDFU-OPSGRANTS DEC-OPS-CUSTOMER-READ decided 2026-10-07 (owner message): temporarily operations and admin have full rights on the customer admin area at ALL (GAP-25 resolved for these keys, GAP-2015 interim until the detailed role design); saveCustomerGroup, deleteCustomerGroup (NKH-US-01..03)

ekyc ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
EKY-01ekyc.readWEB_ADMINoperations admin super_adminALLPROPOSEDPPI-P9-01 (#428, round 2026-10-26-pipoint-integration 04 §3 'Khi User App có wizard eKYC'; owner DEC-PPI-OWN04-EKYC-REVIEW-EARLY 04/11/2026): the PiPoint ekycPlatform-review reads, server to server, nothing stored: ekycRequests (list: PIDEAL's queue and history), ekycRequest (get: identity, checklist, 15-minute images; never your own request), customerIdentity (identity: the customer detail eKYC block); seeded by PPI-P9-01 (migration 20261230060700, -- rbac-forward-grants); SQL helpers pipoint_ekyc.review_people / reviewer_uid / customer_uid re-check the grant
EKY-02ekyc.reviewWEB_ADMINadmin super_adminALLmfa, không tự làmPROPOSEDPPI-P9-01 (owner DEC-PPI-OWN04-EKYC-REVIEW-EARLY 04/11/2026): decideEkycRequest approves / rejects (template reason) a REVIEW request sent from PIDEAL's app (PiPoint decide), MFA step-up action ekyc.review; never your own request: the requester is a PiPoint uid, not an argument, so noSelf is checked in the service after PiPoint get (identity.same_person of the caller and every account linked to the uid, same account or same phone) and PiPoint refuses it again through reviewer.pipointUid; the decision enqueues the PPI-P4-01 status pull (pipoint_ekyc.request_review_sync); seeded by PPI-P9-01 (migration 20261230060700, -- rbac-forward-grants)

media_private ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
MD-07storage.private.readWEB_ADMINALLGAPPD-08 s15 storage.private.read; M-02 AC03 private files need their own permission; role mapping not sourced (GAP-18)
MD-08storage.private.writeWEB_ADMINALLGAPPD-08 s15 storage.private.write; deleting another account's private file; role mapping not sourced (GAP-18)

membership ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
AD-06membership.approveWEB_ADMINadmin super_adminALLmfa, không tự làmPROPOSEDcatalog approveMembership/assignRole; P1-05 self-grant denied; DEC-PPI-OWN02-SUPERADMIN-APPROVE (owner 2026-11-02, option a): super_admin approves too (03 s2: the reviewer of a new staff account), noSelf and MFA kept; seed 20261230051200 (PPI-P2-04), RLS app_memberships_staff_approve names both roles. activateSaleMembership reuses this rule but its SQL also needs role_permission.manage (admin only), so a super_admin is still refused there
AD-11membership.rejectWEB_ADMINadmin super_adminALLmfa, không tự làmPROPOSEDPPI-P0-04 (#428, 03 §3.1 'Từ chối', closes the rejectMembership part of GAP-27): PENDING -> REJECTED of a WEB_ADMIN membership with a reason, the same reviewer shape as AD-06 membership.approve (MFA step-up membership.reject, never on yourself); PPI-P7-01 (DEC-PPI-OWN03-STAFF-ADD-FLOW): also an ACTIVE new staff member without a role, in one command (SQL identity.staff_reject) that rejects the pending role requests, sets the membership REJECTED and revokes the WEB_ADMIN sessions, never by the maker of a pending role request; used to clear self-registered PENDING WEB_ADMIN memberships before the staff cut-over (03 §5, PPI-P2-09); RLS policy app_memberships_staff_reject (PPI-P2-04); DEC-PPI-OWN02-SUPERADMIN-APPROVE (owner 2026-11-02, option a): admin and super_admin, like AD-06; seeded by PPI-P2-04 (migration 20261230051200, -- rbac-forward-grants)

mfa_reset ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
AD-03mfa_reset.requestWEB_ADMINadminALLmaker, mfa, không tự làmDEFINEDPD-08 s19; A-SEC-02 EC01
AD-04mfa_reset.approveWEB_ADMINsuper_adminALLchecker, mfa, không tự làmDEFINEDPD-08 s19

mission_progress ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
MPR-01mission_progress.readAPP_USER, APP_SALEuser saleOWNPROPOSEDP4-06; UA-25 'As a buyer, I want to view progress toward Sale registration and User tier advancement missions' (separate lists by purpose, threshold/achieved/remaining, contributing orders only where the viewer owns the order), SA-08 'Mission progress' (source events when permitted, mask PII); catalog myMissions plus myMissionEvidence added by P4-06; SQL mirror mission.progress_scope() = OWN; permission name not in PD-08 s15 (GAP-05, GAP-174)
MPR-02mission_progress.readWEB_ADMINsale_managerALLPROPOSEDP4-06; A-MIS-04 'As a Sale Manager, I want to look up each User's/Sale's progress' (precondition 'permission to view progress', AC06 no customer data without that permission); catalog missionProgress plus missionEvidence added by P4-06; progress rows carry no team, so scope ALL; SQL mirror mission.progress_scope() = ALL / mission.progress_reader_roles(); separate from MS-01 mission.read (the catalog); permission name not in PD-08 s15 (GAP-05, GAP-174)

notification ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
NTF-01notification.readAPP_USERuserOWNPROPOSEDP4-19; AP-32 Rule 1 (each customer receives one in-app notification per outcome, relevant participants only), UA-X-03 (receive outcome notifications and open the correct order); query myNotifications returns only the caller's own rows (kind + order/campaign references, read state); SQL mirror notification.is_recipient(); inbox/badge are UX proposals (OI-CP-10); permission name not in PD-08 s15 (GAP-05, GAP-108)
NTF-02notification.mark_readAPP_USERuserOWNPROPOSEDP4-19; UA-X-03 read status ('UX must decide inbox/read status'); mutation markNotificationRead sets read_at once on the caller's own notification, idempotent; SQL mirror notification.is_recipient() (GAP-05, GAP-108)

payment_override ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
F-04payment.override.requestWEB_ADMINoperationsALLmaker, mfaDEFINEDPD-08 s19
F-05payment.override.approveWEB_ADMINfinanceALLchecker, mfaDEFINEDPD-08 s19

point_report ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
PRP-01point_report.readWEB_ADMINfinanceALLPROPOSEDP3-23; PDI-07 the Accountant reads the monthly PiPoint report (drafts, versions, per-type totals at each request's own rate, current-period corrections); queries pointReports, pointReport. Permission name not in PD-08 s15 (GAP-05); role mapping GAP-135
PRP-02point_report.settleWEB_ADMINfinanceALLmfaPROPOSEDP3-23; PDI-07 'Accountant can read/export/mark-settled'; settlePointReport is an OFFLINE marker only (no transfer, no ledger, no PiPoint ADJUST); no checker is sourced, so no maker/checker (GAP-136); MFA follows the other Finance writes

reconciliation ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
PRC-01reconcile.readWEB_ADMINfinanceALLPROPOSEDP3-13; PD-08 s14 Finance = Payment/refund/reconciliation (Financial scope); PAY-R1-04 actor 'Kế toán xử lý; người xem có quyền đọc/export'; registry payment.json payment_reconciliation_runs PERM_GATED reconcile.read; catalog momoReconciliation. Name not in PD-08 s15 (GAP-05, GAP-73)
PRC-02reconcile.resolveWEB_ADMINfinanceALLPROPOSEDP3-13; sow/03 s12 'Dòng lệch do Kế toán xử lý (OPEN -> IN_PROGRESS -> RESOLVED), kèm ghi chú và người xử lý', s14 Kế toán 'xử lý dòng lệch đối soát'; PAY-R1-04 steps 4-5; catalog resolveDiscrepancy. Name not in PD-08 s15 (GAP-05, GAP-73)

report_money ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
RPT-02report_money.readWEB_ADMINfinanceALLpii:maskedPROPOSEDP4-20; A-REP-01 AC08 'Role lacks finance permission: run monetary report: block', A-REP-04 EC05 'User lacks money permission: request money dataset: reject', A-REP-06 'Finance report read/export'; gates reportOrders, reportPayments and reportCod (committed value, captured / refunded / UNKNOWN cash, COD delivered / collected / remitted) and fills the VND value of reportPoints; report.read alone never grants a money column; SQL mirror report.access('MONEY'); export stays P4-21 (GAP-199, GAP-200)
RPT-04report_money.exportWEB_ADMINfinanceALLmfa, pii:maskedPROPOSEDP4-21; A-REP-06 'Finance report read/export; MFA is required for privileged access', A-REP-06 EC05 'Account lacks Finance permission: export: reject', A-REP-01 AC08, PAY-R1-07 'Kế toán ... quyền đọc và export riêng'; gates requestReportExport for ORDERS, PAYMENTS and COD (MFA step-up on the request) and the VND value column of POINTS; the actor also needs report_money.read (checked by SQL); download and retry need the grant but no new step-up (GAP-245)

role_assignment ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
AD-01role_permission.manageWEB_ADMINadminALLmaker, mfa, không tự làmDEFINEDPD-08 s15/s19; self-elevation forbidden; A-SEC-04 EC05
AD-02role_permission.approveWEB_ADMINsuper_adminALLchecker, mfa, không tự làmDEFINEDPD-08 s19 checker Super Admin/independent

sale_media ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
MD-14sale_media.uploadWEB_ADMINadmin super_admin sale_managerOWNPROPOSEDU6-P3-38 (contract freeze s7, X-03, K-11, K-19; media-delta s6): SALE_PROFILE_FILE / SALE_PROFILE_IMAGE upload (PRD 04:342, 667-668, 706-707) by the sale.manage roles; seed 20261211090200
MD-15sale_media.deleteWEB_ADMINadmin super_admin sale_managerOWNPROPOSEDU6-P3-38 (contract freeze s7, X-03, K-11, K-19; media-delta s6): soft delete of the caller's own SALE_PROFILE_* media by the sale.manage roles; seed 20261211090200

sale_profile_change ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
SPC-01sale_profile_change.readWEB_ADMINadmin super_adminALLpii:maskedPROPOSEDFU-718; owner decision SPEC-06 (2026-10-05): full name, ID number and bank account of a Sale need Admin approval; queries saleProfileChanges / saleProfileChange (the PROFILE_CHANGE queue and one request); ID number and bank account are masked in the database (****1234), the full name and the Sale's masked phone are shown; no source names a narrower role than Admin (GAP-1441); SQL mirror sale_profile.reviewer_roles() / actor_is_reviewer(); grant seeded by 20261022010300 (-- rbac-forward-grants)
SPC-02sale_profile_change.reviewWEB_ADMINadmin super_adminALLmfa, không tự làmPROPOSEDFU-718; owner decision SPEC-06: Admin (checker; no mc flag, the stored request is the maker step) approves or rejects (with a reason) a Sale's PROFILE_CHANGE request (maker = the Sale, via U-07 profile.manage); reviewSaleProfileChange; reviewer != Sale enforced by the SQL function, a CHECK and the service; MFA step-up required since FU-SALEREVIEWER (DEC-S-APPLICATION-REVIEWER, owner answer 2026-10-06; GAP-1441 MFA part closed), permission risk HIGH by 20261114010000

shortage_case ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
SHR-01ops.shortageWEB_ADMINoperations adminALLPROPOSEDP2-19; A-OD-07 actor Operations Manager reviews affected Orders, delivered cycles, deposit and points before confirming (stockShortageCases/stockShortageCase/stockShortageImpact); registry order_fulfillment.json stock_shortage_cases PERM_GATED ops.shortage; Operations scope TEAM vs ALL is GAP-01 (GAP-83); DEC-OPS-SCOPE decided 2026-10-06 (owner-questions-2026-10-06 OQ-46, extends owner answer #52): Operations holds ALL scope for shortage read (FU-OPSSCOPE, GAP-83/GAP-277) FU-OPSGRANTS DEC-OPS-ADMIN-ALL decided 2026-10-07: admin also holds ops.shortage at ALL (GAP-1920 resolved).
SHR-02ops.shortageWEB_ADMINoperations adminALLPROPOSEDP2-19; A-OD-07 'As an Operations Manager, I want to cancel and refund an order when supply cannot be fulfilled' (recordStockShortage, interim AS-01/AS-02 whole affected Order); who initiates is also DEC-CP-SHORTAGE (open); Operations scope GAP-01 (GAP-83); DEC-OPS-SCOPE decided 2026-10-06 (owner-questions-2026-10-06 OQ-46, extends owner answer #52): Operations holds ALL scope for shortage record (FU-OPSSCOPE, GAP-83/GAP-277) FU-OPSGRANTS DEC-OPS-ADMIN-ALL decided 2026-10-07: admin also holds ops.shortage at ALL (GAP-1920 resolved). | U19-P0-04: opsCancelOrder / opsOrderCancelPreview now guard on ORD-01 order.cancel; ops.shortage is still accepted for them until U19-P4-02 (transition).

tier_multiplier ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ADT-05tier_multiplier.readWEB_ADMINsale_manager business_ownerALLPROPOSEDFU-TIERAPPROVE DEC-POINT-TIER-APPROVAL (decided 2026-10-07): tierMultiplierChanges lists the multiplier change proposals of a DRAFT Tier version with the previous and the proposed values; the proposer (sale_manager, tier.writer_roles()) and the checker (business_owner, tier.multiplier_checker_roles()) read; the Business Owner holds no tier.read (GAP-2059)
ADT-06tier_multiplier.decideWEB_ADMINbusiness_ownerALLchecker, mfaPROPOSEDFU-TIERAPPROVE DEC-POINT-TIER-APPROVAL (decided 2026-10-07): a different business_owner approves or rejects the unchanged proposed multipliers (decideTierMultiplierChange); MFA step-up; the proposer is refused SELF_APPROVAL by the guard, by tier.multiplier_change_guard() and by the table CHECK; the proposal itself is ADT-01 tier.write (sale_manager, the maker, no extra MFA, GAP-2058); publishTierVersion of a changed multiplier set needs the approval (GAP-1965 closed); U28-P0-03 DEC-U28-05: decideTierMultiplierChange removed from the API, the rule stays for a reversal

wallet ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
U-06wallet.readAPP_USER, APP_SALEuser saleOWNPROPOSEDPRD UA-22, SA-06
U-11wallet.linkAPP_USER, APP_SALEuser saleOWNPROPOSEDPDI-01 actor: account owner opens/links My Wallet; PP-02 HC02/ALT02 one wallet across User/Sale; catalog linkPointAccount; P3-18. Verified-eKYC precondition has no source yet (GAP-23)
MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ATR-04affiliate_link.disableWEB_ADMINALLGAPP4-11; admin handoff AD-ATTR-01-stop 'Ngưng Affiliate link: reason required, blocks new opens only, rewards untouched' is a PO proposal naming no role; owner self-disable is not sourced; DEC-S-LOCKED-LINKS open (GAP-58)

audit ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
Z-01audit.readWEB_ADMINsuper_adminALLPROPOSEDexists in repo audit-log work, not in PD-08 catalog (GAP-14); U12-FU-60 (owner answer 2026-10-13, GAP-2302): super_admin only, ALL, no MFA. Consumer: the unmasked old/new values of the product change history (canSeeUnmaskedHistory in product/history-view.ts asks the evaluator for audit.read). The audit-log reads and export still have no operation (GAP-38, GAP-203), so the audit screen stays unavailable. Seed 20261213030000_history_export_permissions.sql.

cashbook ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
RCP-01cashbook.readWEB_ADMINfinanceALLPROPOSEDP3-08; A-CASH-01 'Finance & Accounting views the cashbook' + AC08 'no Finance permission: no access to balance'; PAY-R1-02 'Ke toan doc/doi chieu theo quyen'; PD-08 s14 Finance = Payment/refund/reconciliation; registry cashbook_entries PERM_GATED. Name not in PD-08 s15 (GAP-99)

catalog_history ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
CAT-04catalog.history.exportWEB_ADMINsuper_adminALLmfaPROPOSEDU12-FU-60 (owner answer 2026-10-13, GAP-2301; G-HISTORY export = super_admin only): new permission, MFA step-up before every export like O-04 customer.export (step-up action catalog_history.export); exportProductHistory (ADD-SP-04). The database re-checks the grant in catalog.product_history_export_rows (rbac.actor_holds). Seed 20261213030000_history_export_permissions.sql.

content ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
A-04content.read_publicAPP_USER, APP_SALE, WEB_ADMINanonymousPUBLICPROPOSEDcatalog publicContent: published-only

customer_pii ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
O-05customer.pii.readWEB_ADMINoperations adminALLPROPOSEDPD-08 s15; no role mapping in sources (GAP-12) | U6-P2-23 (final 05-quan-ly-khach-hang.md NFR #4 'chi tai khoan co quyen Quan ly khach hang duoc xem/xuat', KH-US-01/03; contract-freeze s7, X-05, I-01): read without MFA (mfa removed: a step-up grant is consumed per use, every list open would ask MFA, against AC01); same roles as O-01, so every customer reader reads FULL (GAP-12 closed in part). Seed 20261211090000 (-- rbac-forward-grants, integrator); SQL gate customer.actor_can_read() (I-03, no separate pii_reader_roles()).
MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
PRV-07privacy.holdWEB_ADMINALLmfa, không tự làmGAPP1-14; registry legal_holds PERM_GATED privacy.hold; AD-CUST-08-hold 'only Legal/Privacy releases a hold'; Legal/Privacy is not a PD-08 s14 role (GAP-59); setLegalHold/releaseLegalHold not in the catalog; SQL privacy.hold_roles() empty

me ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ME-01me.readAPP_USER, APP_SALE, WEB_ADMINany_memberSELFDEFINED01-foundation P1-05: me works while PENDING

notification_event ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
NTF-03notification_event.readWEB_ADMINadmin super_adminALLpii:maskedPROPOSEDFU-455 (owner decisions 2026-10-06: GAP-455 staff read approved; GAP-459 final, the staff notification screens are Admin only for now, with the role codes role_permission.manage / role_permission.approve borrowed by the web routes until this dedicated permission replaces them); A-NOT-02 / AP-32 name Operations as the story actor but the owner chose Admin; queries notificationEvents / notificationEvent read the P4-19 in-app ledger (filters: recipient app, kind, state, recorded_at window); the recipient is an account reference plus a phone masked in the database (customer.mask_phone), never a raw phone or e-mail; no resend, no mutation, no external channel (R1 in-app only, G-NOT interim); separate from NTF-01 notification.read so staff never reach myNotifications; SQL mirror notification.staff_require() re-checks the live grant (GAP-801..807)

order_refund ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ORD-02order.refund.processWEB_ADMINoperations adminALLDEFINEDB269.R07 (NFR6); B044.R02 AC04 (DH-US-07 Xử lý hoàn tiền). U19-P0-04 (Word v2 Đơn hàng/Vận đơn, NFR #6 B269.R07: xem, hủy đơn, xử lý hoàn tiền, tạo vận đơn, cập nhật vận chuyển là các quyền tách riêng). Interim role mapping operations + admin ALL (the Phân quyền module owns the detailed design). Seeded by 20261223000000 § permissions_word_v2. D-SEC-01 (owner 2026-10-19): one step exactly per Word, NO MFA step-up, NO Finance checker, NO threshold (supersedes DEC-FIN-REFUND-THRESHOLD for the order refund only). confirmRefundTransfer, requestRefundInfoUpdate and the masked refund profile read (U19-P2-15). F-02/F-03 stay for the Finance refund cases until then.

payment_config ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
F-08payment.config.manageWEB_ADMINALLchecker, mfaGAPPD-08 s19 payment/bank config; roles unspecified (GAP-11)

payment_simulator ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
MMO-01payment_simulator.controlWEB_ADMINALLGAPP3-03; UW-PAY-02 'scenario controls are limited to QA/operator test roles in nonproduction' (EC02 buyer calling the scenario endpoint is blocked), UW-PAY-06 'QA injects scenarios in nonproduction; read access does not grant injection rights' (EC01). QA/operator test role is not a PD-08 s14 role (GAP-75). Not used by any guard: no API exposes the simulator controls; the server-side harness drives them (simulator/driver.ts)

privacy_export ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
PRV-04privacy_export.downloadAPP_USERuserOWNPROPOSEDP1-14; catalog privacyExportDownload; A-SEC-06 rule 4/ALT02/EC01 private expiring file for the verified subject only; NFR-PRI-005 audited; the approval is the reviewed privacy request (DB), not an X-01 export approval

profile ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
U-07profile.manageAPP_USER, APP_SALEuser saleOWNPROPOSEDcatalog me/updateMe/address; P1-10 | G1S (#407, S22, BR-KP-02): mySearchHistory / recordSearchKeyword / clearSearchHistory (the caller's own last 5 keywords) ride on this rule; the guard also requires x-pi-app APP_USER (a Sale is forbidden, a guest is unauthorized); no new rule, no grant change.

referral ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ATR-06referral.claimAPP_USERuserOWNPROPOSEDP4-12; UA-27 Rule 2 'Last-Touch at the time the new user signs up determines attribution; each new user can receive a Referral reward only once', SA-13 Rule 2 'the referrer cannot be changed retroactively', domain model Customer.referrer_code (code given at sign-up); mutation claimReferralSignup: the caller binds only itself; SQL mirror attribution.actor_is_referral_claimant(); FU-716 (SPEC-02, decided 2026-10-05) also gates claimAffiliateTouches with this rule: the signed-in caller binds only its own anonymous Affiliate clicks of the last 72 h (GAP-1460); permission name not in PD-08 s15 (GAP-05, GAP-85)

report_pii ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
B-02report.pii.readWEB_ADMINUNDECIDEDmfaGAPPD-08 s29 needs reason+audit (GAP-12)

sale_application_queue ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
AD-08sale_application.queue_readWEB_ADMINadmin super_adminALLPROPOSEDP1-12 + FU-SALEREVIEWER: reviewer queue saleApplications (AP-16 application status filter); DEC-S-APPLICATION-REVIEWER: admin and super_admin, ALL; reading the queue needs no MFA (only the decision does, AD-07); grant seeded by 20261114010000

sale_profile ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
M-05sale_profile.manageWEB_ADMINsale_managerTEAMpii:maskedPROPOSEDPRD AP-17

sale_transition ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
ST-01sale_transition.updateAPP_SALEsaleOWNPROPOSEDFU-866 (owner decisions 2026-10-06 on GAP-865/866/871, recorded by P5-S04): the Sale retries the transfer of its OWN User-to-Sale application (retrySaleTransition, idempotent) and acknowledges that it was shown the completed result (acknowledgeSaleTransition, set once, server side). The read of the transition (saleTransition) reuses TIR-01 tier.read OWN. Nothing names an account or application: both are the verified caller. SA-12 AC06/AC07; A-TIER-05 AC05/AC07

spin_history ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
SPN-05spin.history.readWEB_ADMINoperations adminALLPROPOSEDVQM-P0-03 (#491, Word Vòng quay may mắn 12/11 VQ-US-08 Lịch sử quay, BR-VQLS-01..05; DEC-VQM-12): queries spinSessionHistory and spinSessionHistoryDetail (every buyer's spin sessions with order, customer, campaign, wheel, draws and the Pi-Point outcome). Same roles as SPN-02 spin.read (spin.manager_roles() = {operations,admin}, owner D6 2026-10-22); a separate permission so the tab can be granted without the wheel configuration. Phone FULL only when the caller also holds O-05 customer.pii.read, MASKED otherwise. Grant seeded by VQM-P1-09 migration 20261231080700 (-- rbac-forward-grants); until it runs every caller is denied by actor_grants().

team ​

MãQuyềnỨng dụngVai tròPhạm viCờTrạng tháiNguồn
M-04team.manageWEB_ADMINsale_managerTEAMPROPOSEDA-TEAM-01/02

Sinh từ ad83b0aea · 820 migration · PostgreSQL 17