Commit 948aeb1
fix(intent): generate enforced default roles per entity (#6331)
EdmIntentGenerator hardcoded generateDefaultRoles="false" and never wrote
roleRead/roleWrite, so intent-generated apps had no access control: every
generated REST controller was open and default-roles.roles was empty.
Emit generateDefaultRoles="true" plus the standard
<project>.<perspective>.<Entity>ReadOnly / FullAccess role names for every
real (controller-backed) entity, mirroring the EDM editor's "Generate Default
Roles" checkbox. The perspective segment is the entity's resolved perspective
(resolvePerspective): its own name for a top-level entity, its parent's for a
composition child, and its own name for a setting too (never the "Settings"
shell grouping) - consistent with how regular entities name their roles. The
downstream template-application-rest-java template already consumes this
metadata to emit checkPermissions() and default-roles.roles; no template
change is needed. PROJECTION entities stay unsecured (read-only). The .edm XML
carries the attributes too so a generated .edm opens with the box checked.
Covered by EdmIntentGeneratorTest (regular + setting entity role names,
PROJECTION-stays-false) and IntentEngineIT (model/edm role assertions incl.
the setting entity not using the Settings perspective).
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d1be29c commit 948aeb1
3 files changed
Lines changed: 55 additions & 4 deletions
File tree
- components/engine/engine-intent/src
- main/java/org/eclipse/dirigible/components/intent/generator/edm
- test/java/org/eclipse/dirigible/components/intent/generator/edm
- tests/tests-integrations/src/main/java/org/eclipse/dirigible/integration/tests/api
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| 179 | + | |
178 | 180 | | |
179 | | - | |
| 181 | + | |
180 | 182 | | |
181 | 183 | | |
182 | 184 | | |
| |||
740 | 742 | | |
741 | 743 | | |
742 | 744 | | |
743 | | - | |
| 745 | + | |
744 | 746 | | |
745 | 747 | | |
746 | 748 | | |
| |||
771 | 773 | | |
772 | 774 | | |
773 | 775 | | |
774 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
775 | 779 | | |
776 | 780 | | |
777 | 781 | | |
| |||
1972 | 1976 | | |
1973 | 1977 | | |
1974 | 1978 | | |
1975 | | - | |
| 1979 | + | |
1976 | 1980 | | |
1977 | 1981 | | |
1978 | 1982 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
253 | 256 | | |
254 | 257 | | |
255 | 258 | | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
256 | 291 | | |
257 | 292 | | |
258 | 293 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1825 | 1825 | | |
1826 | 1826 | | |
1827 | 1827 | | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
1828 | 1838 | | |
1829 | 1839 | | |
1830 | 1840 | | |
| |||
1836 | 1846 | | |
1837 | 1847 | | |
1838 | 1848 | | |
| 1849 | + | |
| 1850 | + | |
1839 | 1851 | | |
1840 | 1852 | | |
1841 | 1853 | | |
| |||
0 commit comments