Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

GrantAccessRequest Class

[Applies to: Microsoft Dynamics CRM 2011]

Contains the data that is needed to grant a security principal (user or team) access to the specified record.

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

'Declaration
<DataContractAttribute(Namespace:="http://schemas.microsoft.com/crm/2011/Contracts")> _
Public NotInheritable Class GrantAccessRequest
	Inherits OrganizationRequest

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.


' Grant the team read/write access to the lead.
Dim teamReference = New EntityReference(Team.EntityLogicalName,
                                        _teamId)

Dim grantAccessRequest1 = New GrantAccessRequest With
                         {
                             .PrincipalAccess =
                             New PrincipalAccess With
                             {
                                 .AccessMask = AccessRights.ReadAccess Or AccessRights.WriteAccess,
                                 .Principal = teamReference
                             },
                             .Target = leadReference
                         }

Console.WriteLine("Granting {0} to {1} ({2}) on the lead..." & vbCrLf,
                  AccessRights.ReadAccess Or AccessRights.WriteAccess, GetEntityReferenceString(teamReference),
                  "Team")
_serviceProxy.Execute(grantAccessRequest1)

Message Availability

For this message to work, the caller must be connected to the server.

Usage

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

Privileges and Access Rights

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

Notes for Callers

This action applies to all child records of the target record. For all child records, if the caller does not have share privileges for those entity types, or share rights to the records, the child records are not shared. As a result, the owner of the instance, or a user who shares the instance with share rights, automatically has share rights to all child records of the target record. In this case, only the lack of privileges for a particular entity type prevents the child records from being shared.

For a description of how actions on a parent instance affect child records, see Cascading Behavior.

Supported Entities

The following table shows the default entities that support this message. For the listed entities, the caller must be connected to the server for this message to be available.

Entity Availability

account

Server

annotation

Server

appointment

Server

campaign

Server

campaignactivity

Server

campaignresponse

Server

connection

Server

contact

Server

contract

Server

customeropportunityrole

Server

customerrelationship

Server

duplicaterule

Server

email

Server

fax

Server

goal

Server

goalrollupquery

Server

import

Server

importfile

Server

importmap

Server

incident

Server

incidentresolution

Server

invoice

Server

lead

Server

letter

Server

list

Server

mailmergetemplate

Server

opportunity

Server

opportunityclose

Server

orderclose

Server

phonecall

Server

processsession

Server

queue

Server

quote

Server

quoteclose

Server

recurringappointmentmaster

Server

report

Server

salesorder

Server

serviceappointment

Server

sharepointdocumentlocation

Server

sharepointsite

Server

task

Server

template

Server

userform

Server

userquery

Server

userqueryvisualization

Server

workflow

Server


System.Object
   Microsoft.Xrm.Sdk.OrganizationRequest
    Microsoft.Crm.Sdk.Messages.GrantAccessRequest
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Server 2008

Target Platforms

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

Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.