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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SecLib::AccessCheckEx failed

(0) ShareShare
ReportReport
Posted on by 3,634

I was sharing a few records to users of child business unit but I faced following exception.

SecLib::AccessCheckEx failed. 
Returned hr = -2147187962, ObjectID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,
OwnerId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,
OwnerIdType: 8 and CallingUser: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
ObjectTypeCode: 10048, objectBusinessUnitId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,
AccessRights: 262155

Is there any help on this exception.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Do you have enough permissions? as access rights are related to the permissions.

  • Mohsin Ali Profile Picture
    3,634 on at

    I am system administrator. And this was prompted while I was sharing records through C# code.

  • Guido Preite Profile Picture
    54,086 Moderator on at

    then you should post your C# code, because there is something not working there.

    Probably you need to add other privileges, check this post

    dotnetdust.blogspot.com/.../how-to-interpret-accessrights-numbers.html

  • Mohsin Ali Profile Picture
    3,634 on at

    Following is my code snippet to share record.

     GrantAccessRequest grantRequest = shareRecord(userId, recordId, entity);
     GrantAccessResponse grantResponse = (GrantAccessResponse)service.Execute(grantRequest);
     
     private GrantAccessRequest shareRecord(Guid userId, Guid recordId,string entity)
    {
    	GrantAccessRequest grantRequest = new GrantAccessRequest()
    	{
    		Target = new EntityReference(entity, recordId),
    		PrincipalAccess = new PrincipalAccess() {
    		Principal = new EntityReference("systemuser",userId),
    		AccessMask = AccessRights.WriteAccess|AccessRights.ReadAccess|AccessRights.ShareAccess
    		}
    	};
    	return grantRequest;
    }


  • Community Member Profile Picture
    on at

    The error message means that entity 10048 is missing the permission 262155.

    Now, what entity 10048 is, and what permission 262155 is, I do not know.

    See this blog post on how to decipher the ObjectTypeCode rule30.wordpress.com/.../fixing-a-seclibaccesscheckex-failed-error-in-crm

    Perhaps 262155 is "Share".

  • Mohsin Ali Profile Picture
    3,634 on at

    Erik, Thank you for your reply. I debugged the code from A-Z and find that exception occur for only a few records. for rest of the records it works absolutely fine.

  • Community Member Profile Picture
    on at

    Do these records have different owners with different roles?

  • Mohsin Ali Profile Picture
    3,634 on at

    yes, these records have different owners and their roles may or may not be the same.

  • Community Member Profile Picture
    on at

    Then I suggest controlling their roles' Share rights on the entity in question.

  • Mohsin Ali Profile Picture
    3,634 on at

    `controlling their roles' Share rights on the entity in question`

    Eric I could not got your point here.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans