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 :
Finance | Project Operations, Human Resources, ...
Answered

Revoke assigned organization using odata (SecurityUserRoleOrganizations)

(1) ShareShare
ReportReport
Posted on by 7
I searched through the forums and didn't find much on this topic.  I am trying to delete organizations assigned to a user's assigned roles.

Using an odata request such as https://...dynamics.com/data/SecurityUserRoleOrganizations?$filter=(UserId eq 'userid' and SecurityRoleIdentifier eq 'roleid' and OrganizationId eq 'orgid'), I am able to return (GET) a single matching assignment.  But this type of query cannot DELETE (more than one result returned even if only one match actually exists)

Instead I tried https://...dynamics.com/data/SecurityUserRoleOrganizations(UserId='userid',SecurityRoleIdentifier='roleid',OrganizationType='orgtype',OrganizationId='orgid') and "No HTTP resource was found that matches the request URI.......No route data was found for this request." is returned.

I downloaded the metadata XML (/data/$metadata) file which lists the required keys for the SecurityUserRoleOrganization entity to be: UserId, SecurityRoleIdentifier, OrganizationType, OrganizationId

I can add organization assignments to a user's assigned role.  But deleting them seems to not be possible or I'm just missing something.

I thought maybe I would just delete the role and then add the role back with the valid organization assignments.   But the existing assignments do not get deleted when the role is removed and when added back, the original organization assignments still exist.

Thanks for looking
I have the same question (0)
  • Verified answer
    mb2024 Profile Picture
    7 on at
    For anyone that comes across this, the problem is how OrganizationType was specified:
     
    https://...dynamics.com/data/SecurityUserRoleOrganizations(UserId='userid',SecurityRoleIdentifier='roleid',OrganizationType='orgtype',OrganizationId='orgid')
     
    needs to be:
     
    https://...dynamics.com/data/SecurityUserRoleOrganizations(UserId='userid',SecurityRoleIdentifier='roleid',OrganizationType=Microsoft.Dynamics.DataEntities.OMInternalOrganizationType'orgtype',OrganizationId='orgid')
     
     
     
  • André Arnaud de Calavon Profile Picture
    304,772 Super User 2026 Season 1 on at
    Hi mb2024,
     
    Thanks for providing your own answer on this forum post. I have marked your question to set the status of the question to 'answered'.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 622

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 553 Super User 2026 Season 1

#3
CP04-islander Profile Picture

CP04-islander 430

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans