seanmcne / Microsoft.Xrm.Data.PowerShell

This module uses the CRM connection from Microsoft.Xrm.Tooling.CrmConnector.Powershell and provides common functions to create, delete, query, and update data as well as functions for common tasks such as publishing, and manipulating System & CRM User Settings, etc. The module should function for both Dynamics CRM Online and On-Premise environment.
201 stars 64 forks source link

List user access for a record or revoke all user accesses to a record? #528

Open Henry-Sir opened 8 months ago

Henry-Sir commented 8 months ago

Hello,

Here ist the question of list record access for a user: https://github.com/seanmcne/Microsoft.Xrm.Data.PowerShell/issues/496

I need the whole thing reversed. An overview of all users that have been granted access to a record via Grant-CrmRecordAccess. Is this possible?

Or is there a way to clean up the granted access, like "Remove-CrmRecordAccess -RevokeAll"?

seanmcne commented 8 months ago

If you can find a way, using the api, to do this then it's very likely we could find a way to do it with this (we pretty much have access to anything in the API). In the past, it would be quite difficult to do such an operation. The reason is: users can get access to a record quite a few ways:

It's possible I'm forgetting other ways, additionally, I don't know if there's an easy way to request all direct shares by the users principal (we can get the direct shares for a given record but I don't think there's an api call to retrieve all records shared to a user). However, if I've missed something and you have a way to get all the direct shares to a given user please let me know and we'll see if that's something we can do here. Thanks!