Security Roles, Duties & XDS Policies
Master the F&O security architecture β roles, duties, privileges, permissions, entry points β and implement row-level security with Extensible Data Security (XDS) policies.
How does F&O security work?
Think of a company building with key cards.
Your role (employee, manager, executive) determines which floors you can access. Each floor has duties β things youβre responsible for (like βprocess payrollβ or βapprove invoicesβ). Each duty requires specific privileges β the actual actions you can perform (like βview employee recordsβ or βpost journal entriesβ). And each privilege maps to a specific door (menu item, button, or form) you can open.
F&O stacks these layers: Role β Duty β Privilege β Permission β Securable Object. You never give a user direct access to a form β you assign them a role, and the roleβs duties and privileges determine what they can see and do.
The security hierarchy
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER (e.g. Elena Vasquez) β
β βββ ROLE: Production Manager β
β βββ DUTY: Maintain production orders β
β β βββ PRIVILEGE: Create production order β
β β β βββ PERMISSION: ProdTable (Create) β
β β β βββ PERMISSION: ProdTableListPage (Read) β
β β βββ PRIVILEGE: View production schedule β
β β βββ PERMISSION: ProdSchedule (Read) β
β βββ DUTY: Inquire into production status β
β βββ PRIVILEGE: View production status β
β βββ PERMISSION: ProdStatus form (Read) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Each layer explained
| Layer | What it represents | AOT element | Example |
|---|---|---|---|
| Security Role | A job function assigned to users | SecurityRole | ProductionManager, AccountsPayableClerk |
| Duty | A business responsibility (group of privileges) | SecurityDuty | MaintainProductionOrders, InquireVendorInvoices |
| Privilege | Access to specific entry points at a given level | SecurityPrivilege | ProdTableCreate (Create access to ProdTable menu) |
| Permission | Exact access level on a securable object | Part of privilege definition | Read, Update, Create, Delete, or Invoke |
| Securable Object | The actual UI or service entry point | Menu item, service op, table | ProdTableListPage (menu item display) |
Exam tip: Duties are the key design unit
When the exam asks about security design, duties are the most important layer:
- Roles are assigned to users but are just containers for duties
- Privileges are too granular for business discussion
- Duties represent business responsibilities that auditors understand
Best practice: design duties first (based on business processes), then compose roles from duties. While you CAN assign privileges directly to roles, best practice is to go through duties for auditability and separation of duties (SoD) compliance.
Creating custom security elements
Custom roles
| Step | Detail |
|---|---|
| 1 | In VS, right-click project β Add β New Item β Security Role |
| 2 | Name it descriptively: PFProductionSupervisor |
| 3 | Add duties (not individual privileges) to the role |
| 4 | Set the roleβs context β which legal entities it applies to (if constrained) |
| 5 | Deploy and assign to users in System Administration β Users |
Custom duties
| Step | Detail |
|---|---|
| 1 | Add β New Item β Security Duty |
| 2 | Name: PFMaintainQualityOrders |
| 3 | Add privileges to the duty |
| 4 | Set the dutyβs identifier (used for SoD conflict detection) |
Custom privileges
| Step | Detail |
|---|---|
| 1 | Add β New Item β Security Privilege |
| 2 | Name: PFQualityOrderCreate |
| 3 | Add entry point permissions: select menu items, set access level |
| 4 | Optionally add table permissions for direct data access |
Entry point permissions
Entry points are the doors into F&O β each privilege specifies which doors it opens and at what level:
| Entry point type | Example | Access levels |
|---|---|---|
| Menu item display | Forms and list pages | Read, Update, Create, Delete |
| Menu item output | Reports (SSRS) | Read (view/run the report) |
| Menu item action | Batch jobs, processes | Read (trigger the action) |
| Service operation | Web services, OData | Invoke |
Scenario: Elena designs PacificForge security
Elena works with compliance officer Kenji to design the security model for PacificForgeβs production module:
| Role | Duties | Key privileges |
|---|---|---|
| PF Production Supervisor | Maintain production orders, View production KPIs, Approve quality orders | Create/update prod orders, view dashboards, approve quality |
| PF Production Operator | Record production output, View work instructions | Update route transactions, read-only on BOM |
| PF Quality Inspector | Maintain quality orders, Record test results | Create quality orders, update test measurements |
| PF Production Viewer | Inquire into production status | Read-only on all production forms |
βNotice how the Operator can record output but canβt create or delete production orders,β Elena tells Sophie. βThatβs least privilege β they get exactly what their job requires, nothing more.β
Extensible Data Security (XDS) β row-level security
The role/duty/privilege model controls which forms and actions a user can access. But what about which records they can see? Thatβs where XDS comes in.
What XDS does
XDS applies automatic WHERE clauses to queries, filtering data based on the userβs context. A regional manager sees only their regionβs data β even though they have access to the same forms as other managers.
Without XDS: SELECT * FROM SalesTable
β Returns ALL sales orders (all regions)
With XDS: SELECT * FROM SalesTable
WHERE SalesTable.Region = 'Pacific'
β Returns only Pacific region orders
(filter injected automatically by XDS)
XDS policy components
| Component | Purpose | Example |
|---|---|---|
| Policy | The top-level container | PFRegionalDataPolicy |
| Constrained table | The table being filtered | SalesTable, CustTable |
| Context | What determines the filter value | Current userβs role, current company, custom context |
| Policy query | The filter logic (WHERE clause) | SalesTable.Region = getCurrentUserRegion() |
| Context type | RoleBased (most common) or Application context | Role-based filters by role membership; application by runtime value |
Building an XDS policy
// XDS Policy definition in AOT
// Policy: PFRegionalSalesPolicy
// Constrained table: SalesTable
// Context type: RoleBased
// Primary table: SalesTable
// The policy query joins SalesTable to a mapping table
// that links users to regions. When the policy is active,
// every query against SalesTable automatically includes:
// EXISTS (SELECT 1 FROM UserRegionMapping
// WHERE UserRegionMapping.Region = SalesTable.SalesRegion
// AND UserRegionMapping.UserId = currentUserId())
Scenario: Elena implements regional data security
PacificForge has three regional offices (Pacific, Americas, Europe). Each regional sales manager should only see their regionβs customers and orders.
Elenaβs XDS implementation:
- Creates a UserRegionMapping table linking user IDs to regions
- Creates an XDS policy
PFRegionalDataPolicywith:- Constrained tables:
SalesTable,CustTable,SalesLine - Context:
RoleBased(applies when user has the Regional Sales Manager role) - Query: EXISTS join to UserRegionMapping where Region matches
- Constrained tables:
- Assigns the policy to the PF Regional Sales Manager role
Result: when a Pacific manager opens the Sales Orders list, they automatically see only Pacific region orders. The WHERE clause is injected invisibly β no code changes needed on any form.
βThe beauty is that every form, every report, every export that touches SalesTable is automatically filtered,β Elena tells DBA Harpreet. βWe donβt have to modify each one individually.β
Exam tip: XDS vs form-level filtering
The exam may present scenarios where you need to choose between XDS and form-level filtering:
- XDS β automatic, applies everywhere (forms, reports, exports, services), enforced at the database query level. Use for security requirements.
- Form-level filtering β manual, applies only to that form, can be bypassed. Use for convenience/UX, not security.
If the requirement says βusers must NOT be able to see other regionsβ dataβ β XDS (security). If it says βdefault the form to the userβs regionβ β form filter (convenience).
Security diagnostics
Troubleshooting access issues
| Tool | Purpose | Location |
|---|---|---|
| Security diagnostics | Traces why a user can or canβt access something | System Administration β Security β Security diagnostics |
| View permissions | Shows all effective permissions for a user | User details β View permissions |
| Role assignments | Lists all roles assigned to a user | System Administration β Users β select user β Assign roles |
| Security configuration | Visualises the role β duty β privilege tree | System Administration β Security β Security configuration |
| Segregation of duties | Detects conflicting duties assigned to the same user | System Administration β Security β Segregation of duties |
Scenario: Debugging a missing menu item
Sophie reports that a production operator canβt see the βRecord Outputβ menu item. Elenaβs debugging steps:
- Check role assignment β is the user assigned the PF Production Operator role? β Yes
- Check duty β does the role include the βRecord production outputβ duty? β Yes
- Check privilege β does the duty include the privilege for the menu item? β Missing!
- Fix β add the
ProdRouteTransCreateprivilege to the duty - Verify β re-check using Security Diagnostics β user can now see the menu item
βAlways start from the user and work down the chain,β Elena advises. βRole β Duty β Privilege β Entry Point. The break is almost always a missing privilege.β
Segregation of duties (SoD)
SoD rules prevent users from having conflicting responsibilities β like βcreate vendorβ AND βapprove vendor paymentsβ (fraud risk).
| Concept | Detail |
|---|---|
| SoD rule | Defines two duties that should never be assigned to the same user |
| SoD conflicts | System reports violations when roles create conflicts |
| Resolution | Split duties across different roles, or document an exception |
| Audit trail | SoD violations are logged for compliance auditing |
Elena needs to ensure that PacificForge's regional sales managers can only see customer records from their own region. The filter must apply everywhere β forms, reports, and exports. What should she implement?
Compliance officer Kenji needs to ensure no single user can both create vendors AND approve vendor payments. Which security feature should Elena configure?
Sophie creates a custom privilege for a new report but users still can't see it. The privilege has the correct menu item entry point. What is the most likely missing step?
Elena is choosing the correct access level for a privilege that allows production operators to view (but not modify) production orders. Which entry point access level should she set?
Next up: Performance, Caching & Set-Based Operations β table caching strategies, temp tables, set-based patterns, and concurrency control in X++.