Add Role Member

API Type

Web Services

Description

Adds a user or a group to a role.

Syntax

public virtual WFRoleMember AddRoleMember(string RoleName, string Assignee, string AssigneeType, string ClientData, string ObjectID, string ObjectType);

Parameters

Name Description

RoleName

Definition:
The name of a role.
Type
string
Allowed Values:
A valid role name.

Assignee

Definition:
The name of the assignee.
Type
string
Allowed Values:
A valid user name or group name, depending upon the assignee type.

AssigneeType

Definition:
The type for the assignee for the task.
Type
string
Allowed Values:
  • User - Assigns the task to a user.
  • Group - Assigns the task to a group.

ClientData

Definition:
Specifies the client data, which identifies a client for AgilePoint Server.
Type
string
Allowed Values:
A string that contains the client data.

If this value is null, the system will keep existing client data. Otherwise the relevant data is overwritten.

ObjectID

Definition:
Reserved for future use.
Type
string
Allowed Values:
A null value.

ObjectType

Definition:
Reserved for future use.
Type
string
Allowed Values:
A null value.

Output

WFRoleMember object.

Example

IWFAdminService svc = GetAdminService();                              

string RoleName = "Administrative";
string Assignee = @"Demo3\Administrator";
string AssigneeType = "User";

try
    {
    WFRoleMember member = svc.AddRoleMember(RoleName, Assignee,
    AssigneeType, "", null, null);
    }

catch (Exception ex)
    {
    Console.WriteLine("Failed! " + ShUtil.GetSoapMessage(ex));
    }

Supported Versions

3.2.0.4 and higher