ModifyAccessRequest Class
Applies To: Microsoft Dynamics CRM 2013, Microsoft Dynamics CRM Online
Contains the data that is needed to replace the access rights on the target record for the specified security principal (user or team).
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 ModifyAccessRequest
Inherits OrganizationRequest
[DataContractAttribute(Namespace="https://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class ModifyAccessRequest : 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.
// Grant the first user delete access to the lead.
var modifyUser1AccessReq = new ModifyAccessRequest
{
PrincipalAccess = new PrincipalAccess
{
AccessMask = AccessRights.DeleteAccess,
Principal = systemUser1Ref
},
Target = leadReference
};
Console.WriteLine("Granting delete access to {0} on the lead...\r\n",
GetEntityReferenceString(systemUser1Ref));
_serviceProxy.Execute(modifyUser1AccessReq);
' Grant the first user delete access to the lead.
Dim modifyUser1AccessReq = New ModifyAccessRequest With
{
.PrincipalAccess =
New PrincipalAccess With
{
.AccessMask = AccessRights.DeleteAccess,
.Principal = systemUser1Ref
},
.Target = leadReference
}
Console.WriteLine("Granting delete access to {0} on the lead..." & vbCrLf,
GetEntityReferenceString(systemUser1Ref))
_serviceProxy.Execute(modifyUser1AccessReq)
Remarks
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 ModifyAccessResponse class.
Privileges and Access Rights
To perform this action, the caller must have privileges on the entity that is specified in the Target property and access rights on the record that is specified in the Target property. For a list of the required privileges, see ModifyAccess Privileges.
Notes for Callers
This action applies to all child records of the target entity 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 entity record, or a user who shares the record that has share rights, automatically has share rights to all child records of the target entity record. In this case, only the lack of privileges to a particular entity type prevents the child records from being shared.
For a description of how actions on a parent record 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 |
---|
account |
annotation |
appointment |
campaign |
campaignactivity |
campaignresponse |
connection |
contact |
contract |
customeropportunityrole |
customerrelationship |
duplicaterule |
emailserverprofile |
fax |
goal |
goalrollupquery |
import |
importfile |
importmap |
incident |
incidentresolution |
invoice |
lead |
letter |
list |
mailbox |
mailmergetemplate |
opportunity |
opportunityclose |
orderclose |
phonecall |
processsession |
queue |
quote |
quoteclose |
recurringappointmentmaster |
report |
salesorder |
serviceappointment |
sharepointdocumentlocation |
sharepointsite |
task |
template |
userform |
userquery |
userqueryvisualization |
workflow |
Inheritance Hierarchy
System.Object
Microsoft.Xrm.Sdk.OrganizationRequest
Microsoft.Crm.Sdk.Messages.ModifyAccessRequest
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
ModifyAccessRequest Members
Microsoft.Crm.Sdk.Messages Namespace
Actions on Entity Records
ModifyAccessResponse
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.