web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Getting privilege error while updating account through organization service

(0) ShareShare
ReportReport
Posted on by 505

I'm getting the following error while updating an account through organization service in c#.

SecLib::CrmCheckPrivilege failed. Returned hr = -2147220943 on UserId: 331387b0-323e-e611-80e3-c4346bdc11e1 and PrivilegeType: Read

Principal user (Id=331387b0-323e-e611-80e3-c4346bdc11e1, type=8 , accessMode=0, roleCount=1 ) is missing prvReadAccount privilege (Id=886b280c-6396-4d56-a0a3-2c1b0a50ceb0)

Weird thing is that this user is different from the one which I'm using for organization service.

CRM version is 9.0

The user specified in the error does have Read Account privilege.

*This post is locked for comments

I have the same question (0)
  • RajatSharmaRaj Profile Picture
    on at
    RE: Getting privilege error while updating account through organization service

    Are you using plugin or workflow? You need to see which user's context is being used. Since you mentioned that the user id in error not same as your user this clearly indicate the code is not running in context of your user account but some other user account details which is missing the read access.

    Or if you can trying to read CRM from some other c# app then you should be creating a connection to CRM using some user details in code, so you need to check access for that user.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Getting privilege error while updating account through organization service

    Hi Priyank,

    How you are triggerring your code ? Is it plugins or through services which has hosted in IIS?

    If you are triggering your code using services check IIS app pool USER whether it's using any other user which does not have read privileges of account entity.

    If you are triggering code using plugins then check the plugin registration tool which user you set .

    Or you can simply give the user security role with all  access of account entity.

  • Suggested answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at
    RE: Getting privilege error while updating account through organization service

    Similar thread: community.dynamics.com/.../235900

  • Suggested answer
    linu John Profile Picture
    215 on at
    RE: Getting privilege error while updating account through organization service

    There will be multiple reason

    1. It seems there is cascade update happening with its related records . This userid is owner of any related records   Please check all relation with other entity and check owner

    2. It may be from plugin . please disable plugin steps on update of account entity  and then try .

  • Verified answer
    Priyank Bhavsar Profile Picture
    505 on at
    RE: Getting privilege error while updating account through organization service

    Thanks all for you response. It is a console application. The issue was that the user whose GUID is mentioned in the error was disabled and that user was set to one of the lookup fields on the record which I was trying to update. I had to change the value of the lookup field to fix this issue.

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Getting privilege error while updating account through organization service

    Were you changing the owner field or using the assign request? If yes then during that operation, the permissions of the disabled users is also checked.

  • Priyank Bhavsar Profile Picture
    505 on at
    RE: Getting privilege error while updating account through organization service

    No, I was not changing the owner field.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans