Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to set depth of RolePrivilege entity

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I'm trying to create a Role with Microsoft CDS web api, but I don't know how to set its privilege levels. I mean, I can create the role and assign privileges to it, but their level/depth is set to 0 (User).

I've tried updating the privilegedepthmask property of the RolePrivilege entity, but I get the following error in the response:

{
    "error": {
        "code": "0x80040800",
        "message": "The 'Update' method does not support entities of type 'roleprivileges'."
    }
}

When creating the role, I assign the privileges like this:

{
    "businessunitid@odata.bind": "/businessunits(6efad0b7-160b-eb11-a812-000d3ab2a6be)",
    "name": "Security Role Test",
    "roleprivileges_association@odata.bind": [
        "/privileges(2493b394-f9d7-4604-a6cb-13e1f240450d)",
        "/privileges(707e9700-19ed-4cba-be06-9d7f6e845383)",
        "/privileges(e62439f6-3666-4c0a-a732-bde205d8e938)",
        "/privileges(e3f45b8e-4872-4bb5-8b84-01ee8f9c9da1)",
        "/privileges(f36ff7e9-72b9-4882-afb6-f947de984f72)",
        "/privileges(886b280c-6396-4d56-a0a3-2c1b0a50ceb0)"
    ]
}

Is there a way to set the privilege depth via the web api? Thanks!

  • Malvtrics Profile Picture
    Malvtrics on at
    How to set depth of RolePrivilege entity
    I have encountered the same issue, have you successfully resolve it?
  • Pedro Rosa Profile Picture
    Pedro Rosa 5 on at
    RE: How to set depth of RolePrivilege entity

    Thanks for the reply Yiming I'm using the Web API. That document states:

    "For the Web API use the PrivilegeDepth EnumType."

    But it doesn't say how to update it. Which endpoint should I use for that purpose, do you know?

  • Suggested answer
    Yiming  Profile Picture
    Yiming on at
    RE: How to set depth of RolePrivilege entity

    Hi,

    Please check the below documentation and see if it helps:

    docs.microsoft.com/.../microsoft.crm.sdk.messages.privilegedepth

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,622 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans