Wednesday, 27 February 2013

Find out if the user is an administrator

Today I wanted to find out if the logged in user in Dynamics AX 2012 is an administrator so I did a bit of search and found out the solution.

SecurityRights secRights = SecurityRights::construct();

if(secRights.isSystemAdministrator())
{
    info('User is an admin');
}


This posting is provided "AS IS" with no warranties. Use code at your own risk.

No comments:

Post a Comment