Update Role

API Type

Web Services

Description

Updates information for a role.

Syntax

public virtual WFRole UpdateRole(string RoleName, string Description, int[] Rights, bool Enabled)

Parameters

Name Description

RoleName

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

Description

Definition:
A free text description of an entity.
Type
string
Allowed Values:
A string that can contain spaces and special characters.

Rights

Definition:
Specifies the rights that are assigned to the Role.
Type
WFAccessRights
Allowed Values:
An array of index values. See the table for appropriate indexes.

WFAccessRights provides the enums for rights. See the sample code for more information.

Enabled

Definition:
Enables or disables an entity.
Type
bool
Allowed Values:
  • True - Enables the entity.
  • False - Disables the entity.

Output

An updated WFRole object.

Example

IWFAdminService svc = GetAdminService();
string RoleName = ...// for example, "TestRole"
string Description = ...// for example, "This is new description for TestRole"
List<int> list = new List<int>();
list.Add(WFAccessRights.AddModifyGroup);
list.Add(WFAccessRights.AddModifyRole);
list.Add(WFAccessRights.AddModifyUser);
list.Add(WFAccessRights.AddProcessTemplate);
list.Add(WFAccessRights.AddRemoveModifyDelegation);
int[] Rights = list.ToArray();

try
	{
    WFRole updatedRole = svc.UpdateRole(RoleName, Description, Rights, true);
	}

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

Supported Versions

3.2.0.4 and higher