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


|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | projectsWithPermissionForUser(user, permissionKey) | **Package** |  |
| **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Retrieves the project keys where the given user has the given permission.

Retrieves the project keys where the given user has the given permission.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| user | String | Yes | Username. |
| permissionKey | String | Yes | Key of the permission. |

## Return Type

**String[]**

The return value is a string array containing all the project keys where the given user has the given permission.

## Example

```
return projectsWithPermissionForUser("admin", "ADMINISTER_PROJECTS"));
```

Result: DEMO|ITSD|TST

## See also

> Macro (contentbylabel)