Role-based security in Dynamics 365 for Operations. Export security changes and Security diagnostics tool.

As we know from my previous post we can create security artifacts from Visual Studio and user interface. Now we want to deploy them. All objects created in VS could be deployed via deployable package, there is no difference with any code you created. Changes done from UI could be deployed as data via data package. Out of the box we have three data entity to work with security customizations:

SecurityCustomizationEntities.jpg

In the export file for duty customization we will get duty name and xml object contains all privileges assigned to the duty. Other two (roles and privileges) have similar structure.

ExportedDutyChanges.jpg

ExportedDutyChangesXML.jpg

That’s a big improvement in security setup, because in AX 2012 it was hard to track what changes were done in test environment and should be transferred to live.

Security diagnostics tool

To easy the problem of security setup in AX 2012 we have Security Development Tool, unfortunately, it’s not available in current version (Microsoft is working on the replacement). However, there is another useful tool – Security diagnostics tool.

Each form in AX has “Options” tab on the action pane where you can find “Security diagnostics” button. It shows you a list of all roles, duties and privileges that grant access to current form. Using buttons on the top of the dialog you can add role to specific user, duty to specific role or privilege to specific duty to quickly grant access to current form.

SecurityDiagnosticsFromForm.jpg

Using task recorder to setup security.

Task recorder  has been re-built in current release and could be used in different scenarios apart of actual task recording. One of them is security setup, now you can analyse task recording with Security diagnostics tool.

Create task recording.

taskrecorder

taskrecordersteps

Save it.

taskrecordersavesteps

Go to System administrations -> Security -> Security diagnostics for task recordings and open saved recording.

SecurityDiagnosticsOpenRecording.jpg

As the result you will see all menu items involved. When you select user AX shows if he already has permission to entry points.

SecurityDiagnosticsSelectUser.jpg

“Add reference” button will open you Security diagnostics dialog, exactly the same we saw using Security diagnostics tool, where you can do all the setup.

SecurityDiagnosticsAddtoUsersRole.jpg

Advertisements

5 thoughts on “Role-based security in Dynamics 365 for Operations. Export security changes and Security diagnostics tool.

  1. krishna January 22, 2017 / 3:16 pm

    Hi Ievgen,
    It’s been a while, I noticed that you have been publishing good articles about AX7 development.

    I’ve a suggestion, as I believe User interface is key role in the blog.
    Change your blog user interace like
    1.Right hand side it should show all the articles with Groups,,,, So that someone could easily could access all the articles under the groups.
    As of now the blog has article one by one, it’s like a going train.

  2. Andreas April 10, 2018 / 3:51 pm

    thank you for the great blog. do yo also know why there are import and export options for roles and how to export just one role with all included details in it? So that I can export it from Test and import it into PROD system?

    • Ievgen Miroshnikov April 10, 2018 / 8:02 pm

      I don’t think that there is an entity to export all duties and privileges of one role and it does not make sense for me because same duty could be used by multiple roles and same privilege by multiple duties and roles. I mentioned 3 data entities in the beginning of the post , you can use them for export\import and if you want to filter data before export you can use standard data migration filter functionality.

      • Andreas April 11, 2018 / 5:18 am

        Hello Ievgen, from my Point of view there is a requirement. Not for the existing rules. But if I create a new privilege (for example for customized fields) with new duties and new role – it makes sense to Export this only from TEST Environment and Import it to PROD Environment. Why else there is an EXPORT and IMPORT menu in Standard?

  3. door November 26, 2018 / 7:34 am

    Just want to say your article is as astounding.
    The clarity in your post is simply spectacular and i could assume you’re an expert on this subject.
    Fine with your permission allow me to grab your RSS
    feed to keep updated with forthcoming post. Thanks a million and
    please keep up the rewarding work.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s