Share via


RetrievePrincipalAccessRequest Class

Applies To: Microsoft Dynamics CRM 2013, Microsoft Dynamics CRM Online

Contains the data that is needed to retrieve the access rights of the specified security principal (team or user) to the specified record.

Namespace: Microsoft.Crm.Sdk.Messages
Assembly: Microsoft.Crm.Sdk.Proxy (in Microsoft.Crm.Sdk.Proxy.dll)

Syntax

'Declaration
<DataContractAttribute(Namespace:="https://schemas.microsoft.com/crm/2011/Contracts")> _
Public NotInheritable Class RetrievePrincipalAccessRequest
    Inherits OrganizationRequest
[DataContractAttribute(Namespace="https://schemas.microsoft.com/crm/2011/Contracts")] 
public sealed class RetrievePrincipalAccessRequest : OrganizationRequest

Example

The following example shows how to use this message. For this sample to work correctly, you must be connected to the server to get an IOrganizationService interface. For the complete sample, see the link later in this topic.

var principalAccessReq = new RetrievePrincipalAccessRequest
{
    Principal = principal,
    Target = leadReference
};
var principalAccessRes = (RetrievePrincipalAccessResponse)
    _serviceProxy.Execute(principalAccessReq);
Console.WriteLine("Access rights of {0} ({1}) on the lead: {2}\r\n",
    GetEntityReferenceString(principal),
    additionalIdentifier,
    principalAccessRes.AccessRights);
Dim principalAccessReq = New RetrievePrincipalAccessRequest With
                         {
                             .Principal = principal,
                             .Target = leadReference
                         }
Dim principalAccessRes = CType(_serviceProxy.Execute(principalAccessReq), 
    RetrievePrincipalAccessResponse)
Console.WriteLine("Access rights of {0} ({1}) on the lead: {2}" & vbCrLf,
                  GetEntityReferenceString(principal),
                  additionalIdentifier,
                  principalAccessRes.AccessRights)

Remarks

Message Availability

This message works regardless whether the caller is connected to the server or offline. However, a few entities of this message class are exceptions to that availability. To determine which entities have a more restricted availability, see Supported Entities later in this topic.

Usage

Pass an instance of this class to the Execute method, which returns an instance of the RetrievePrincipalAccessResponse class.

Privileges and Access Rights

To perform this action, the caller must have privileges on the entity that is specified by the Target property and access rights on the specified record in the Target property. For a complete list of the required privileges, see RetrievePrincipalAccess Privileges.

Supported Entities

The following table shows the default entities that support this message. For the listed entities of this message, the Availability column shows Server if the caller must be connected to the server and shows Both if the caller can be either connected to, or disconnected from, the server.

Entity Availability

account

Both

annotation

Both

appointment

Both

asyncoperation

Both

bulkoperation

Both

campaign

Both

campaignactivity

Both

campaignresponse

Both

connection

Both

contact

Both

contract

Both

customeropportunityrole

Both

customerrelationship

Both

duplicaterule

Server

email

Both

emailserverprofile

Server

fax

Both

goal

Both

goalrollupquery

Both

import

Both

importfile

Both

importmap

Both

incident

Both

incidentresolution

Both

invoice

Both

lead

Both

letter

Both

list

Both

mailbox

Server

mailmergetemplate

Both

opportunity

Both

opportunityclose

Both

orderclose

Both

phonecall

Both

processsession

Both

queue

Both

quote

Both

quoteclose

Both

recurringappointmentmaster

Both

report

Both

salesorder

Both

serviceappointment

Both

sharepointdocumentlocation

Both

sharepointsite

Both

task

Both

template

Both

userform

Both

userquery

Both

userqueryvisualization

Both

workflow

Server

Inheritance Hierarchy

System.Object
   Microsoft.Xrm.Sdk.OrganizationRequest
    Microsoft.Crm.Sdk.Messages.RetrievePrincipalAccessRequest

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2008, Windows Server 2012, Windows 7 (All Versions), Windows 8 (All Versions)

Target Platforms

Windows Server 2008, ,Windows Server 2012, ,Windows 7 (All Versions),

Change History

See Also

Reference

RetrievePrincipalAccessRequest Members
Microsoft.Crm.Sdk.Messages Namespace
Entity Ownership
RetrievePrincipalAccessResponse

Other Resources

How Record-Based Security Can Be Used to Control Access to Records In Microsoft Dynamics CRM
Sample: Share Records Using GrantAccess, ModifyAccess and RevokeAccess Messages

Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.