Creating a New POS Permission for AX Retail 6

Embed Size (px)

Citation preview

  • 8/12/2019 Creating a New POS Permission for AX Retail 6

    1/8

    Creating a new POS Permission for AX Retail 6.2

    OverviewPermissions are the way that AX for Retail 6.2 enforces role-based feature access in the POS client.Permissions can be associated with POS operations and automatically evaluated at run-time todetermine if the current operator has the requisite feature-access to perform the operation.Additionally, using the extensibility framework in POS, ISVs can check Permissions from their owncustom modules.

    Data model

    RetailPosPermissionsGroup tableThis table is the target of all Permissions. Each permission check will resolve to the look -upand evaluation of a boolean column on the RetailPosPermissionGroup table.

    RetailPermissions tableThis table is the definition of the Permission, defining the way by which other systems refer to it,as well as providing the mapping to the permission target in the RetailPosPermissionsGroup table. The PermissionId is used to call the UserAccessSystem module to evaluate thePermission at run-time.

    RetailOperations tableThis table is primarily used for defining Operations that appear in the POS client UI, but includesfields for associating a primary ( Permission ID ) and secondary ( Permission ID2 ) Permission thatwill be automatically evaluated when the Operation is invoked at run- time. The Check useraccess column is used to enable/disable Permission evaluation for the operation; the definedPermissions are ONLY evaluated in the POS client if Check user access is checked.

    Creating a new permission target1. Add new column to RetailPosPermissionGroup table in AX. It should be a Boolean/NoYes

    enum.a. In this example we create a field called salesRepPrivileges.

  • 8/12/2019 Creating a New POS Permission for AX Retail 6

    2/8

  • 8/12/2019 Creating a New POS Permission for AX Retail 6

    3/8

  • 8/12/2019 Creating a New POS Permission for AX Retail 6

    4/8

    2. Drag the new column to the Permissions field group

  • 8/12/2019 Creating a New POS Permission for AX Retail 6

    5/8

    3. Add new column to the POS dba. Create and execute a SQL script similar to the following on each POS db:

    ALTER TABLE RETAILPOSPERMISSIONGROUP ADD

    [SALESREPPRIVILEGES] [int] NULL

    GO

    4. Include new column in Store Connect jobs

    a. Add new field to Retail channel schemai. AX > CEU > Retail > Setup > Retail scheduler > Retail channel schema

    ii. Click on Location tables iii. Select the RetailPosPermissionGroup table

    iv. Click on Location fields and add a new row for the new POS db column

    b. Add the new field to the relevant scheduler subjobs

  • 8/12/2019 Creating a New POS Permission for AX Retail 6

    6/8

    i. Select RetailPosPermissionGroup jobs

    ii. Click Transfer field list

    iii. Click New and specify From field and To field

    Create a new permission1. Navigate to AX > CEU > Retail > Setup > POS > Profiles > Permission groups2. Click New to a dd new record3. Specify unique value for Permission Id

  • 8/12/2019 Creating a New POS Permission for AX Retail 6

    7/8

  • 8/12/2019 Creating a New POS Permission for AX Retail 6

    8/8

    Evaluate a permission from custom code1. Get reference to UserAccessSystem service instance.2. Call .UserHasPermission () passing the PermissionID value defined above.

    IApplication application = this .InternalApplication;IUserAccessSystem userAccess = application.BusinessLogic.UserAccessSystem;string userId = "10001" ;int permissionId = 2001;bool hasPermission = userAccess.UserHasPermission(userId, permissionId);