|
1 | 1 | # @objectstack/example-crm |
2 | 2 |
|
| 3 | +## 4.0.92-rc.6 |
| 4 | + |
| 5 | +### Patch Changes |
| 6 | + |
| 7 | +- 7e06f51: fix(example-crm): bind the three declared positions to `crm_sales_user` (#8060) |
| 8 | + |
| 9 | + `examples/app-crm/src/security/sales-positions.ts` declared three positions |
| 10 | + (`sales_rep`, `sales_manager`, `finance_approver`) and a `crm_sales_user` |
| 11 | + permission set, but nothing ever joined them — the app seeded no |
| 12 | + `sys_position_permission_set` rows, and `crm_sales_user` was not marked |
| 13 | + `isDefault` (which would have granted every user, not just the three |
| 14 | + positions). A user assigned any of the three positions therefore resolved |
| 15 | + only the platform `everyone` baseline and was 403'd on every CRM object. |
| 16 | + |
| 17 | + Mirrors `examples/app-showcase/src/security/bind-position-sets.ts`: a new |
| 18 | + `examples/app-crm/src/security/bind-position-sets.ts` binds the three |
| 19 | + positions to `crm_sales_user` imperatively on `kernel:bootstrapped` (a |
| 20 | + declarative seed can't do this — the seed loader runs before the security |
| 21 | + bootstrap creates the `sys_position`/`sys_permission_set` rows), wired via a |
| 22 | + new `onEnable` export in `objectstack.config.ts`. |
| 23 | + |
| 24 | + Measured with `objectstack verify --app examples/app-crm/objectstack.config.ts |
| 25 | +--rls`: the three per-position probe personas went from 18-of-18 |
| 26 | + `probe-blocked` (no object grant at all — the by-id-write class was never |
| 27 | + exercised) to 3 `probe-blocked` (one per persona: `crm_opportunity_line_item`, |
| 28 | + which `crm_sales_user` does not grant — a separate, pre-existing gap, not |
| 29 | + addressed here). Zero RLS holes introduced or found. |
| 30 | + |
| 31 | +- c4624f0: fix(example-crm): grant `crm_opportunity_line_item` in `crm_sales_user`, matching its master `crm_opportunity` (#8164) |
| 32 | + |
| 33 | + `crm_opportunity_line_item` is a master-detail CHILD of `crm_opportunity` |
| 34 | + (`sharingModel: 'controlled_by_parent'`, `inlineEdit: 'grid'` on the |
| 35 | + Opportunity form), but `crm_sales_user` — the app's only non-guest |
| 36 | + permission set — granted object-level CRUD on 5 CRM objects and never the |
| 37 | + line item. Record-level access always follows the master (ADR-0055), but |
| 38 | + object-level CRUD is a SEPARATE gate the platform never derives: every |
| 39 | + role-bound (non-admin) user, including the three positions this app ships |
| 40 | + to demonstrate selling, got a silent 403 the moment they tried to add or |
| 41 | + edit a product line on an Opportunity they otherwise fully own. The |
| 42 | + platform's own build-time lint (`security-master-detail-ungranted`) already |
| 43 | + flagged this independently. |
| 44 | + |
| 45 | + Added `crm_opportunity_line_item` to `crm_sales_user`'s `objects` map with |
| 46 | + the exact same grant shape as its master `crm_opportunity` |
| 47 | + (`{ allowRead: true, allowCreate: true, allowEdit: true, allowDelete: false }`) |
| 48 | + — the line item's own access is meant to follow its master, not invent an |
| 49 | + independent policy. |
| 50 | + |
| 51 | + Measured with `objectstack verify --app examples/app-crm/objectstack.config.ts |
| 52 | +--rls`: every position persona's `probeBlocked` count dropped from 1 (the |
| 53 | + line item, the sole remaining gap left open by #8060) to 0, with zero RLS |
| 54 | + holes introduced or found. The build's `security-master-detail-ungranted` |
| 55 | + warning for this object is gone. |
| 56 | + |
| 57 | +- 450f3e5: fix(examples): name the form/page sections that had a label but no `name`, and translate the headings into zh-CN (#8231) |
| 58 | + |
| 59 | + `translation-section-name-missing` fired on every build of both example apps: a |
| 60 | + form or `record:details` section that declares a `label` but no `name` has no |
| 61 | + key a bundle can carry (`objects.<object>._sections.<name>.label`), so its |
| 62 | + heading renders in the source locale in EVERY locale — permanently, and |
| 63 | + invisibly, because every neighbouring field label on the same object |
| 64 | + translates fine. `app-crm` ships en + zh-CN; `app-showcase` ships the same. |
| 65 | + |
| 66 | + 21 of the 24 flagged sections now declare a stable snake_case `name` and |
| 67 | + resolve a real (non-echoed) zh-CN label: |
| 68 | + |
| 69 | + - **app-crm** (9/9): `crm_activity` (`activity_details`, `related_records`, |
| 70 | + `notes`), `crm_lead` (`contact_us`, `lead_information`, `qualification`, |
| 71 | + `conversion`, `notes`), `crm_opportunity` (`opportunity`). |
| 72 | + - **app-showcase** (12/15): `showcase_project` form (`project`, |
| 73 | + `budget_schedule`) and its detail page (`overview`, `financials`, |
| 74 | + `timeline`); `showcase_task`'s detail page (`overview`, `schedule`, |
| 75 | + `details` — reusing the same names and zh-CN copy its `tabbed` form view |
| 76 | + already declares, so no new bundle entries were needed there); |
| 77 | + `showcase_inquiry` (`tell_us_about_yourself`); `showcase_business_unit` |
| 78 | + (`unit`); `showcase_preference`'s settings page (`appearance`, |
| 79 | + `notifications`). |
| 80 | + |
| 81 | + **Not named here — a `packages/**`conflict, out of this PR's scope.** Three`app-showcase` sections (`showcase_task`'s `formViews.edit`/`Task`and`formViews.quick`/`Quick Edit`, `showcase_contact`'s `formViews.create`/`Who is |
| 82 | + this?`) are pinned NAMELESS as regression fixtures by |
| 83 | +`packages/lint/src/validate-translatable-sections.test.ts`and`validate-translation-references.test.ts`, which import `TaskViews`/`ContactViews`directly from this app and assert on their current unnamed |
| 84 | +shape. Naming them requires a coordinated`packages/lint` test update; #8231 |
| 85 | + remains open for that follow-up. |
| 86 | + |
| 87 | + Adding a `name` alone would have silenced the warning with zero translation |
| 88 | + delivered, so both apps also gain a generalized i18n-coverage sweep test |
| 89 | + (`examples/app-crm/test/i18n-sections.test.ts`, |
| 90 | + `examples/app-showcase/test/seed.test.ts`) asserting every section this PR |
| 91 | + touches BOTH has a `name` AND resolves a real, non-ASCII zh-CN |
| 92 | + `_sections.<name>.label` — not just that the section has a name. |
| 93 | + |
| 94 | +- Updated dependencies [690ccf2] |
| 95 | +- Updated dependencies [333a374] |
| 96 | +- Updated dependencies [30536e3] |
| 97 | +- Updated dependencies [5823d59] |
| 98 | +- Updated dependencies [3140f9c] |
| 99 | +- Updated dependencies [9500ba4] |
| 100 | +- Updated dependencies [a8940e4] |
| 101 | +- Updated dependencies [76d74ec] |
| 102 | +- Updated dependencies [0e79785] |
| 103 | +- Updated dependencies [116c0d9] |
| 104 | +- Updated dependencies [a98085f] |
| 105 | +- Updated dependencies [344a22a] |
| 106 | +- Updated dependencies [4827e91] |
| 107 | +- Updated dependencies [86f7a20] |
| 108 | +- Updated dependencies [c546c89] |
| 109 | +- Updated dependencies [627e65a] |
| 110 | +- Updated dependencies [b16dcb4] |
| 111 | +- Updated dependencies [22df871] |
| 112 | +- Updated dependencies [9c82146] |
| 113 | +- Updated dependencies [744b8f5] |
| 114 | +- Updated dependencies [37785ed] |
| 115 | +- Updated dependencies [7e5af5c] |
| 116 | +- Updated dependencies [9d1d9c7] |
| 117 | +- Updated dependencies [1007379] |
| 118 | +- Updated dependencies [4ff8abf] |
| 119 | +- Updated dependencies [e5bd2f6] |
| 120 | +- Updated dependencies [e38db3d] |
| 121 | +- Updated dependencies [2c1988c] |
| 122 | +- Updated dependencies [211abdb] |
| 123 | +- Updated dependencies [b3de0dd] |
| 124 | +- Updated dependencies [35b36f2] |
| 125 | +- Updated dependencies [19aaf4b] |
| 126 | +- Updated dependencies [0e4a7fb] |
| 127 | +- Updated dependencies [f505689] |
| 128 | +- Updated dependencies [76682cb] |
| 129 | +- Updated dependencies [606d577] |
| 130 | +- Updated dependencies [e906126] |
| 131 | +- Updated dependencies [08363a0] |
| 132 | +- Updated dependencies [444de5b] |
| 133 | +- Updated dependencies [3f7b4ff] |
| 134 | +- Updated dependencies [2bacd1a] |
| 135 | +- Updated dependencies [6a9dec6] |
| 136 | +- Updated dependencies [4dc1c7d] |
| 137 | +- Updated dependencies [baeb4f0] |
| 138 | +- Updated dependencies [29488cc] |
| 139 | +- Updated dependencies [859cb83] |
| 140 | +- Updated dependencies [08cd163] |
| 141 | +- Updated dependencies [7dc1067] |
| 142 | +- Updated dependencies [7674859] |
| 143 | +- Updated dependencies [427344c] |
| 144 | +- Updated dependencies [b85cc54] |
| 145 | +- Updated dependencies [7a8476f] |
| 146 | +- Updated dependencies [518ca7a] |
| 147 | +- Updated dependencies [2d8dba3] |
| 148 | +- Updated dependencies [d62f8eb] |
| 149 | +- Updated dependencies [a7586cd] |
| 150 | +- Updated dependencies [4c5e80e] |
| 151 | +- Updated dependencies [4b5702a] |
| 152 | +- Updated dependencies [af05400] |
| 153 | +- Updated dependencies [36d90fc] |
| 154 | +- Updated dependencies [d063a96] |
| 155 | +- Updated dependencies [fa48973] |
| 156 | +- Updated dependencies [cf7c694] |
| 157 | +- Updated dependencies [ddd0f06] |
| 158 | +- Updated dependencies [603cab8] |
| 159 | +- Updated dependencies [df95346] |
| 160 | +- Updated dependencies [591f675] |
| 161 | +- Updated dependencies [d56012f] |
| 162 | +- Updated dependencies [9051802] |
| 163 | +- Updated dependencies [2f8328c] |
| 164 | +- Updated dependencies [2a6c279] |
| 165 | +- Updated dependencies [8c8f0df] |
| 166 | +- Updated dependencies [f293d45] |
| 167 | +- Updated dependencies [f067930] |
| 168 | +- Updated dependencies [6b7129a] |
| 169 | +- Updated dependencies [97ace2a] |
| 170 | +- Updated dependencies [ef7b5ef] |
| 171 | +- Updated dependencies [9514767] |
| 172 | +- Updated dependencies [8f20201] |
| 173 | +- Updated dependencies [8813b90] |
| 174 | +- Updated dependencies [8f1851e] |
| 175 | +- Updated dependencies [b4b2c7d] |
| 176 | +- Updated dependencies [61ea810] |
| 177 | +- Updated dependencies [66d99ec] |
| 178 | +- Updated dependencies [cb43296] |
| 179 | +- Updated dependencies [91eddca] |
| 180 | +- Updated dependencies [b61afc1] |
| 181 | +- Updated dependencies [79021fc] |
| 182 | +- Updated dependencies [7dbf4c3] |
| 183 | +- Updated dependencies [9b2d720] |
| 184 | +- Updated dependencies [95ef5c0] |
| 185 | +- Updated dependencies [97b6658] |
| 186 | +- Updated dependencies [27358d5] |
| 187 | +- Updated dependencies [76bcb83] |
| 188 | +- Updated dependencies [0410522] |
| 189 | +- Updated dependencies [814db6d] |
| 190 | +- Updated dependencies [8dd98bf] |
| 191 | +- Updated dependencies [8a9c079] |
| 192 | +- Updated dependencies [cc3555e] |
| 193 | +- Updated dependencies [b30963d] |
| 194 | +- Updated dependencies [ea936f3] |
| 195 | +- Updated dependencies [69ac82c] |
| 196 | +- Updated dependencies [833ed84] |
| 197 | +- Updated dependencies [a18abf3] |
| 198 | +- Updated dependencies [86d2e5e] |
| 199 | +- Updated dependencies [c6a4eeb] |
| 200 | +- Updated dependencies [f450ae7] |
| 201 | +- Updated dependencies [e9cb9ab] |
| 202 | +- Updated dependencies [5326b36] |
| 203 | +- Updated dependencies [e124711] |
| 204 | +- Updated dependencies [3bb9340] |
| 205 | +- Updated dependencies [9d4dfc4] |
| 206 | +- Updated dependencies [1059965] |
| 207 | +- Updated dependencies [ee264b2] |
| 208 | +- Updated dependencies [60b672e] |
| 209 | +- Updated dependencies [6b441a8] |
| 210 | +- Updated dependencies [dd0f681] |
| 211 | +- Updated dependencies [e654bfd] |
| 212 | +- Updated dependencies [6e6c872] |
| 213 | +- Updated dependencies [fa5758e] |
| 214 | +- Updated dependencies [ecf0bef] |
| 215 | +- Updated dependencies [3da3da5] |
| 216 | +- Updated dependencies [a0fdc56] |
| 217 | +- Updated dependencies [0dcbc11] |
| 218 | +- Updated dependencies [d88f3e9] |
| 219 | +- Updated dependencies [b9f930b] |
| 220 | +- Updated dependencies [289d04a] |
| 221 | +- Updated dependencies [c9b809f] |
| 222 | +- Updated dependencies [89be40c] |
| 223 | +- Updated dependencies [32386f8] |
| 224 | +- Updated dependencies [bbe05de] |
| 225 | +- Updated dependencies [a1dd1e4] |
| 226 | + - @objectstack/runtime@17.0.0-rc.7 |
| 227 | + - @objectstack/spec@17.0.0-rc.7 |
| 228 | + |
3 | 229 | ## 4.0.92-rc.5 |
4 | 230 |
|
5 | 231 | ### Patch Changes |
|
0 commit comments