Skip to content

Commit d522e2a

Browse files
akoclaude
andcommitted
Fix MDL syntax in XPath examples
- Associations: use FROM/TO syntax instead of inline (*/1) notation - GRANT: use READ *, WRITE * instead of READ ALL, WRITE ALL - Rename CreatedDate to RegistrationDate to avoid system attribute conflict Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c42621d commit d522e2a

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

.claude/skills/mendix/xpath-constraints.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ For security rules, XPath is passed as a **string literal** (not parsed):
183183

184184
```mdl
185185
GRANT Module.Role ON Module.Entity (
186-
READ ALL,
187-
WRITE ALL
186+
READ *,
187+
WRITE *
188188
) WHERE '[System.owner = ''[%CurrentUser%]'']';
189189
```
190190

mdl-examples/doctype-tests/16-xpath-examples.mdl

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CREATE PERSISTENT ENTITY XpathTest.Customer (
2424
Name: String(200),
2525
Email: String(200),
2626
IsActive: Boolean,
27-
CreatedDate: DateTime,
27+
RegistrationDate: DateTime,
2828
Country: String(100)
2929
);
3030

@@ -48,17 +48,20 @@ CREATE PERSISTENT ENTITY XpathTest.Category (
4848
IsVisible: Boolean
4949
);
5050

51-
CREATE ASSOCIATION XpathTest.Order_Customer (
52-
XpathTest.Order * -- XpathTest.Customer 1
53-
);
51+
CREATE ASSOCIATION XpathTest.Order_Customer
52+
FROM XpathTest.Order TO XpathTest.Customer
53+
TYPE Reference
54+
OWNER Default;
5455

55-
CREATE ASSOCIATION XpathTest.OrderLine_Order (
56-
XpathTest.OrderLine * -- XpathTest.Order 1
57-
);
56+
CREATE ASSOCIATION XpathTest.OrderLine_Order
57+
FROM XpathTest.OrderLine TO XpathTest.Order
58+
TYPE Reference
59+
OWNER Default;
5860

59-
CREATE ASSOCIATION XpathTest.Order_Category (
60-
XpathTest.Order * -- XpathTest.Category 1
61-
);
61+
CREATE ASSOCIATION XpathTest.Order_Category
62+
FROM XpathTest.Order TO XpathTest.Category
63+
TYPE Reference
64+
OWNER Default;
6265

6366
-- ============================================================================
6467
-- MARK: Simple Attribute Comparisons
@@ -481,8 +484,8 @@ CREATE PAGE XpathTest.ActiveCustomerPage (
481484
* Entity access with XPath constraint (row-level security)
482485
*/
483486
GRANT XpathTest.User ON XpathTest.Order (
484-
READ ALL,
485-
WRITE ALL
487+
READ *,
488+
WRITE *
486489
) WHERE '[System.owner = ''[%CurrentUser%]'']';
487490

488491
-- ============================================================================

0 commit comments

Comments
 (0)