---
title: "userRoles"
canonical: "https://support.appfire.com/space/PSJ/15486534/userRoles"
format: markdown
---
> Macro (aura-html)


|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | userRoles(project, user) | **Package** |  |
| **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Returns the roles of the provided user in the project.

Returns the roles of the provided user in the project.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| project key | String | Yes | Key of the selected project |
| user | String | Yes | The user name of the user that is verified. |

## Return Type

**String []**

Returns a list of roles the user associated with the given user has on the specified project.

## Examples

### Example 1

```
//dev1 has the following roles in the project PRJ: developer, tester, business analyst.
string user;
string[] roles;
user = "dev1";
roles = userRoles(project, user);
print ("The user " + user + "has the following roles in the project" + project + ":");
print(roles);
```

Result: The user dev1 has the following roles in the project PRJ: developer, tester, business analyst. Check the values in log on the next row beginning with  <StringPrintFunction>.

### Example 2

```
//current user has the following roles in the project PRJ: developer, tester, business analyst.
string[] roles;
roles = userRoles(project, currentUser());
print ("The current user has the following roles in the project" + project + ":");
print(roles);
```

Result: The current user has the following roles in the project PRJ: developer, tester, business analyst. Check the values in log on the next row beginning with <StringPrintFunction>.

## See also

> Macro (contentbylabel)