RetrieveSharedPrincipalsAndAccess Message
Retrieves all of the security principals (users or teams) that have access to a lead and their access rights for the specified entity.
The relevant classes are specified in the following table.
Type | Class |
Request | RetrieveSharedPrincipalsAndAccessRequest |
Response | RetrieveSharedPrincipalsAndAccessResponse |
Target | TargetOwned Class |
Entity | See below. |
The following table shows the entities and target classes for this message.
Remarks
To perform this action, the caller must have access rights on the entity instance specified in the request class. For a list of required privileges, see RetrieveSharedPrincipalsAndAccess Privileges.
Example
The following code example shows how to use the RetrieveSharedPrincipalsAndAccess message.
[C#]
// Set up the CRM Service.
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Create the target object for the request.
TargetOwnedAccount target = new TargetOwnedAccount();
// Set the properties of the target object.
// EntityId is the object that access is being checked to.
target.EntityId = new Guid("6A92D3AE-A9C9-4E44-9FA6-F3D5643753C1");
// Create the request object.
RetrieveSharedPrincipalsAndAccessRequest retrieve = new RetrieveSharedPrincipalsAndAccessRequest();
// Set the properties of the request object.
retrieve.Target = target;
// Execute the request.
RetrieveSharedPrincipalsAndAccessResponse retrieved = (RetrieveSharedPrincipalsAndAccessResponse)service.Execute(retrieve);
[Visual Basic .NET]
' Set up the CRM Service.
Dim service As New CrmService()
service.Credentials = System.Net.CredentialCache.DefaultCredentials
' Create the target object for the request.
Dim target As New TargetOwnedAccount()
' Set the properties of the target object.
'EntityId is the object that access is being checked to.
target.EntityId = new Guid("6A92D3AE-A9C9-4E44-9FA6-F3D5643753C1");
' Create the request object.
Dim retrieve As New RetrieveSharedPrincipalsAndAccessRequest()
' Set the properties of the request object.
retrieve.Target = target
' Execute the request.
Dim retrieved As RetrieveSharedPrincipalsAndAccessResponse = CType(service.Execute(retrieve), RetrieveSharedPrincipalsAndAccessResponse)
Related Topics