Skip to main content

Notifications

Announcements

No record found.

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
  • André Arnaud de Calavon Profile Picture
    294,145 Super User 2025 Season 1 on at
    Revoke assigned organization using odata (SecurityUserRoleOrganizations)
    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'.
  • Verified answer
    mb2024 Profile Picture
    7 on at
    Revoke assigned organization using odata (SecurityUserRoleOrganizations)
    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')
     
     
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,145 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,917 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans