Get Access Rights

API Type

Web Services

Description

Retrieves the access rights for a specified user.

Syntax

public virtual int[] GetAccessRights(string userName)

Parameters

Name Description

userName

Definition:
The user name for the user.
Type
string
Allowed Values:
A valid user name for a registered AgilePoint user.

Output

An array of integers that represent the access rights of the user.

Example

IWFAdminService svc = GetAdminService();
string userName = ...// for example, "Demo3\\ap_svc"

try
	{
    string[] accessNames = svc.GetAccessRightNames();
    int[] userRights = svc.GetAccessRights(userName);
    Console.WriteLine("The user has the following rights:");
    foreach (int rightCode in userRights)
        {
        Console.WriteLine(accessNames[rightCode]);
        }
	}

catch (Exception ex)
	{
    Console.WriteLine("Failed! " + ShUtil.GetSoapMessage(ex));
	}
/*
This example produces the following results:
The user has the following rights:
Register and modify the user information
Unregister a user
Add and modify the role information
Remove a role
Add and modify the group information
Remove a group
Modify/View the system configuration
Add a process definition
Checkin and checkout a process definition
Delete and disable a process definition
...
*/

Supported Versions

3.2.0.4 and higher