Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Access denied Issue in AIF services and Batch job for system Administrator

(0) ShareShare
ReportReport
Posted on by 10

Hi,

For past few days we are facing Access denied Issue for most of our custom AIF services and few batch job for system administrator.

As we have 6 AOS (2 for Batch jobs, 2 for client, and 2 for Services). We get this error in random manner. Sometimes only in few servers. When we point the services or batch to alternate cluster AOS, it works fine( sometimes).

We did AXbuild compile, Full CIL, Sync. Deleted XppIl folder and also AIF Service form Refresh.

But this issue happens mostly after AOS restart.

Version:

AX 2012 R3 CU13.

Error in AIF service: "Access denied to method read in class <ClassName>".

Error In Batch job: "Access denied: SysOperationServiceController"

But we have added the code permissions and the user is system administrator.

Kindly Suggest us how to fix this issue.

Regards,

Muhil

  • Suggested answer
    TracyXing Profile Picture
    on at
    RE: Access denied Issue in AIF services and Batch job for system Administrator

    From code:

    public void checkAccess()

    {

       SecurityRights rights;

       DictMethod dictMethod;

       // get service operation will validate className and methodName

       dictMethod = this.getServiceOperation();

       if (dictMethod)

       {

           rights = SecurityRights::construct();

           if (rights.hasServerMethodAccess(className, methodName))

           {

               return;

           }

       }

       // super throws an access denied exception

       super();

    }

    Suggest to debug this code and check which right it used and find the right in AOT and add the missing method to server method

  • Dyanamics Ax 2012 Access denied Issue for system Adminstrator Profile Picture
    10 on at
    RE: Access denied Issue in AIF services and Batch job for system Administrator

    If it is for other role I would have added it. But I am facing this issue for system admin.

  • Suggested answer
    TracyXing Profile Picture
    on at
    RE: Access denied Issue in AIF services and Batch job for system Administrator

    For the Error in AIF service: "Access denied to method read in class <ClassName>", please try this link: https://axtechbirchendale.wordpress.com/2016/05/17/ax-2012-access-denied-to-method-within-class/

  • udaY-ch Profile Picture
    4,624 on at
    RE: Access denied Issue in AIF services and Batch job for system Administrator

    Hi,

    Error in batch mode.

    As you can see, this is the code being used to check access for the job runs in the batch job mode.

    SysOperationServiceController\CheckAccess

    public void checkAccess()

    {

       SecurityRights rights;

       DictMethod dictMethod;

       // get service operation will validate className and methodName

       dictMethod = this.getServiceOperation();

       if (dictMethod)

       {

           rights = SecurityRights::construct();

           if (rights.hasServerMethodAccess(className, methodName))

           {

               return;

           }

       }

       // super throws an access denied exception

       super();

    }

    This method has to hit return else it gonna throw an error when it made to the super() call.

    So, there are two chances likely to get an error here.

    1. If dictMethod, getServiceOperation returns null.

    2. If user has no rights. You mentioned, The user has System administrator rights.

    If rights isn't the issue then I would say, system cannot find the service class and its entry point which could also lead to an error.

    Uday

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,041 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,856 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans