@Huma Selot CU200816...
Why XDS alone is insufficient:
XDS policies enforce row-level filtering at the AOT query layer. OData and Data Entity calls execute through a separate service stack that bypasses this layer unless the entity is specifically configured to respect it.
The three layer pattern:
Layer 1 — XDS policy on the root table:
Create your XDS security policy targeting HcmWorker or the specific compensation table as the constrained table. Ensure your policy's primary table matches the exact root data source of the HR Data Entity — not just the form data source. If the entity uses a view check the underlying base table the view pulls from.
Layer 2 — AOSAuthorization property on the Data Entity:
Open your HR Data Entity in Visual Studio. Set AOSAuthorization to CreateReadUpdateDelete. This forces the entity to respect AOS security checks including your XDS predicate when called via OData or DMF. Without this property set the entity bypasses your XDS policy entirely regardless of how well it is configured.
Layer 3 — Explicit Data Entity security privilege:
Create a dedicated privilege for the HR compensation data entity with Read permissions scoped only to authorized HR roles. Remove the entity from any broad standard roles that grant blanket data service access — particularly roles that include Data entity wildcard grants. This ensures unauthorized users cannot call the OData endpoint at all.
For Open in Excel specifically:
The Office integration uses the same OData stack. Layers 1 and 2 together enforce XDS on Open in Excel exports. Test by attempting an Open in Excel export as a restricted user — only their authorized compensation rows should appear.
Additional hardening for payroll specifically:
Consider setting the Data Entity's IsPublic property to No in Visual Studio — this removes it from the public OData metadata endpoint entirely, making it invisible to third party API discovery tools scanning your environment.
All three layers must be configured together. Any single layer alone leaves a gap.
If it helps, Mark answered.