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