Share via


RetrieveTeamPrivilegesRequest Class

Definition

Contains the data that is needed to retrieve the privileges for a team.

public ref class RetrieveTeamPrivilegesRequest sealed : Microsoft::Xrm::Sdk::OrganizationRequest
[System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")]
public sealed class RetrieveTeamPrivilegesRequest : Microsoft.Xrm.Sdk.OrganizationRequest
[<System.Runtime.Serialization.DataContract(Namespace="http://schemas.microsoft.com/crm/2011/Contracts")>]
type RetrieveTeamPrivilegesRequest = class
    inherit OrganizationRequest
Public NotInheritable Class RetrieveTeamPrivilegesRequest
Inherits OrganizationRequest
Inheritance
RetrieveTeamPrivilegesRequest
Attributes

Examples

The following example shows how to use this message. For this sample to work correctly, you must have an authenticated connection to the server with a client that implements the IOrganizationService interface instance.

/// <summary>
/// Writes the privileges of a team to the console.
/// </summary>
/// <param name="service">Authenticated client implementing the IOrganizationService interface</param>
/// <param name="teamId">ID of the team</param>
static void OutputTeamPrivileges(IOrganizationService service, Guid teamId)
{
    var request = new RetrieveTeamPrivilegesRequest { TeamId = teamId };
    var response = (RetrieveTeamPrivilegesResponse)service.Execute(request);

    foreach (RolePrivilege rp in response.RolePrivileges) {
        Console.WriteLine($"Name:{rp.PrivilegeName}\tDepth: {rp.Depth}");
    }
}

Example Output:

Name:prvCreateWorkflowSession   Depth: Basic
Name:prvReadWorkflowSession     Depth: Global
Name:prvWriteWorkflowSession    Depth: Basic
Name:prvDeleteWorkflowSession   Depth: Basic
Name:prvAppendWorkflowSession   Depth: Basic

Remarks

For the Web API use the RetrieveTeamPrivileges function.

Usage

Pass an instance of this class to the Execute(OrganizationRequest) method, which returns an instance of the RetrieveTeamPrivilegesResponse class.

Privileges and Access Rights

To perform this action, the caller must have privileges on the Privileges entity and access rights on the specified record in the TeamId property.

Constructors

RetrieveTeamPrivilegesRequest()

Initializes a new instance of the RetrieveTeamPrivilegesRequest class.

Properties

ExtensionData

Gets or sets the structure that contains extra data. Optional.

(Inherited from OrganizationRequest)
Item[String]

Gets or sets the indexer for the Parameters collection.

(Inherited from OrganizationRequest)
Parameters

Gets or sets the collection of parameters for the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
RequestId

Gets or sets the ID of the request. Optional.

(Inherited from OrganizationRequest)
RequestName

Gets or sets the name of the request. Required, but is supplied by derived classes.

(Inherited from OrganizationRequest)
TeamId

Gets or sets the team for which you want to retrieve privileges.

Applies to

See also