Skip to main content

Security Privileges

A Security Privilege (AxSecurityPrivilege) is the atomic permission unit in the D365 F&O security model. Each privilege grants a specific access level to one or more entry points (menu items or service operations), and optionally specifies data entity permissions, direct table access, and form control overrides.

Privileges do not exist in isolation — they are referenced by duties (recommended) or directly by roles.


Access Levels

Entry points within a privilege use the AccessGrant type to specify the level of access:

LevelDescription
No AccessNo access granted (default).
ReadCan read records.
UpdateCan read and modify records.
CreateCan read, modify, and create records.
CorrectCan modify posted/historical records (date-effective access).
DeleteFull access including delete.

For date-effective tables, privileges support period-specific grants:

  • Grant — the base access level.
  • GrantCurrentData — access to current-period records.
  • GrantFutureData — access to future-dated records.
  • GrantPastData — access to historical records.

Child Collections

A privilege contains four child collections:

CollectionChild TypePurpose
EntryPointsAxSecurityEntryPointReferenceMenu item and service operation references — the primary way to grant access.
DataEntityPermissionsAxSecurityDataEntityPermissionPermissions for OData/data management access to data entities.
DirectAccessPermissionsAxSecurityDataEntityReferenceDirect table/view access grants outside the entry-point model.
FormControlOverridesAxSecurityFormControlReferenceCollectionOverrides that hide or disable specific form controls for this privilege level.

Entry Points

The EntryPoints collection is the most commonly used child. Each AxSecurityEntryPointReference maps to a menu item (Display, Output, or Action) or a service operation:

PropertyTypeDescription
NameStringIdentifier for this entry-point reference.
ObjectNameStringThe AOT name of the menu item or service operation.
ObjectTypeEntryPointTypeThe type of entry point. Values: None (0), MenuItemDisplay (1), MenuItemOutput (2), MenuItemAction (3), ServiceOperation (76)
ObjectChildNameStringThe method name (for service operations).
GrantAccessGrantBase access level granted.
GrantCurrentDataAccessGrantAccess level for current-period data.
GrantFutureDataAccessGrantAccess level for future-period data.
GrantPastDataAccessGrantAccess level for past-period data.
TagsStringTags for this element separated by semicolon.

Each entry-point reference can further contain Forms children (AxSecurityEntryPointReferenceForm) that define form-level control and data source overrides for that specific entry point.


Data Entity Permissions

The DataEntityPermissions collection grants access to data entities through OData and the data management framework. Each AxSecurityDataEntityPermission has:

PropertyTypeDescription
NameStringThe AOT name of the data entity.
IntegrationModeIntegrationModeWhich integration channels the permission applies to. Values: All (0), DataServices (1), DataManagement (2)
GrantAccessGrantAccess level granted to the data entity.

Data entity permissions also support Fields and Methods child collections for field-level and method-level security.


Direct Access Permissions

DirectAccessPermissions grant direct table or data entity access outside the entry-point model. Each AxSecurityDataEntityReference specifies:

PropertyTypeDescription
NameStringThe AOT name of the table or data entity.
GrantAccessGrantBase access level.
GrantCurrentDataAccessGrantCurrent-period access.
GrantFutureDataAccessGrantFuture-period access.
GrantPastDataAccessGrantPast-period access.
TagsStringTags for this element separated by semicolon.

Form Control Overrides

FormControlOverrides (AxSecurityFormControlReferenceCollection) allow a privilege to hide or disable specific form controls. This is useful when a form is accessible but certain fields or buttons should not be visible at this access level.

Each collection entry identifies a form by name and contains Controls children that specify the individual controls to override.


Standard Privileges

PrivilegeAOT NameDescription
View vendorsVendTableViewRead access to the vendor master list.
Maintain vendorsVendTableMaintainFull CRUD access to vendor records.
Post vendor invoicesVendInvoicePostPost vendor invoices to the ledger.
View purchase ordersPurchTableViewRead access to purchase orders.
Maintain sales ordersSalesTableMaintainFull CRUD access to sales orders.

Creating a Security Privilege

  1. In Visual Studio, right-click your project and select Add → New Item → Security Privilege.
  2. Set the Name, Label, and Description properties.
  3. Add entry-point references under the Entry Points node — specify the menu item, object type, and access level.
  4. Optionally add data entity permissions or form control overrides.
  5. Build and deploy.

Code Example — Checking Privilege Access Programmatically


Properties

25/25 properties
PropertyDisplay NameTypeDescription
Security PrivilegeAxSecurityPrivilege
NameNameStringThe name of the element.
IsObsoleteIs ObsoleteNoYesDetermines whether the element is deprecated or not. Values: No (0), Yes (1)
VisibilityVisibilityCompilerVisibilityThe visibility of the element. Values: Private (0), Protected (1), Public (2), Internal (3), InternalProtected (4)
TagsTagsStringTags for this element separated by semicolon.
LabelLabelStringPrivilege name that is displayed.
DescriptionDescriptionStringPrivilege description that is displayed.
EnabledEnabledNoYesSet to false to hide the node from the security framework. Values: No (0), Yes (1)
Entry Point ReferenceAxSecurityEntryPointReference
NameNameStringThe name of the element.
ObjectNameObject NameStringThe name of the referenced entry point (menu item or service operation).
ObjectTypeObject TypeEntryPointTypeThe type of entry point. Values: None (0), MenuItemDisplay (1), MenuItemOutput (2), MenuItemAction (3), ServiceOperation (76)
ObjectChildNameMethod NameStringThe child method name (for service operations).
GrantAccess LevelAccessGrantBase access level granted to data.
GrantCurrentDataCurrent Access LevelAccessGrantAccess level granted to current-period data.
GrantFutureDataFuture Access LevelAccessGrantAccess level granted to future-period data.
GrantPastDataPast Access LevelAccessGrantAccess level granted to past-period data.
TagsTagsStringTags for this element separated by semicolon.
Data Entity PermissionAxSecurityDataEntityPermission
NameNameStringThe AOT name of the data entity.
IntegrationModeIntegration ModeIntegrationModeWhich integration channels the permission applies to. Values: All (0), DataServices (1), DataManagement (2)
GrantGrantAccessGrantAccess level granted to the data entity.
Direct Access PermissionAxSecurityDataEntityReference
NameNameStringThe AOT name of the table or data entity.
GrantAccess LevelAccessGrantBase access level granted to data.
GrantCurrentDataCurrent Access LevelAccessGrantAccess level granted to current-period data.
GrantFutureDataFuture Access LevelAccessGrantAccess level granted to future-period data.
GrantPastDataPast Access LevelAccessGrantAccess level granted to past-period data.
TagsTagsStringTags for this element separated by semicolon.