RetrieveUserPrivileges Message
Retrieves all the privileges a user has through his or her roles in the specified business unit.
The relevant classes are specified in the following table.
Type | Class |
Request | RetrieveUserPrivilegesRequest |
Response | RetrieveUserPrivilegesResponse |
Entity | privilege |
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 RetrieveUserPrivileges Privileges.
Example
The following code example demonstrates how to use the RetrieveUserPrivileges message.
[C#]
// Set up the CRM Service.
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Create the request object.
RetrieveUserPrivilegesRequest retrieve = new RetrieveUserPrivilegesRequest();
// Set the properties of the request object.
retrieve.UserId = user.UserId;
// Execute the request.
RetrieveUserPrivilegesResponse retrieved = (RetrieveUserPrivilegesResponse) service.Execute(retrieve);
[Visual Basic .NET]
' Set up the CRM Service.
Dim service As New CrmService()
service.Credentials = System.Net.CredentialCache.DefaultCredentials
' Create the request object.
Dim retrieve As New RetrieveUserPrivilegesRequest()
' Set the properties of the request object.
retrieve.UserId = user.UserId
' Execute the request.
Dim retrieved As RetrieveUserPrivilegesResponse = CType(service.Execute(retrieve), RetrieveUserPrivilegesResponse)
Related Topics