---
url: /process-functions/security-application-users-interface.md
description: The users assigned to an application.
---

# &#x20;ApplicationUsers&#x20;

The users assigned to an application.

```js
const app = security.application("My Application");
app.users.add("user@example.com");
```

## Constructor

Reached through the [users](/process-functions/security-application#properties) property of an [ApplicationSecurity](/process-functions/security-application). It can't be created directly.

## Overview

* **Users:** methods that take a user accept their id, email address or a [User](/process-functions/userSecurity-user).

## Methods

### list `list()`  {#list}

Returns every [User](/process-functions/userSecurity-user) assigned to the application.

### get `get(user)`  {#get}

Returns a [User](/process-functions/userSecurity-user) assigned to the application, or `null` when they aren't assigned.

| Parameter | Type | Description |
|---|---|---|
| `user` | `number \| string` | The user's id or email address. |

### exists `exists(user)`  {#exists}

Returns `true` when a user is assigned to the application.

| Parameter | Type | Description |
|---|---|---|
| `user` | `number \| string \| User` | The user's id or email address, or the user. |

### add `add(user)`  {#add}

Assigns a user to the application. Returns `true` when they were added, or `false` when they're already assigned or can't be found.

| Parameter | Type | Description |
|---|---|---|
| `user` | `number \| string \| User` | The user's id or email address, or the user. |

### remove `remove(user)`  {#remove}

Unassigns a user from the application. Returns `true` when they were removed.

| Parameter | Type | Description |
|---|---|---|
| `user` | `number \| string \| User` | The user's id or email address, or the user. |

### removeAll `removeAll()`  {#removeall}

Unassigns every user from the application.

## Examples

```js
const app = security.application("My Application");
const currentUser = userSecurity.users.getCurrent();

if (!app.users.exists(currentUser)) {
    app.users.add(currentUser);
}

for (const user of app.users.list()) {
    console.log(user.getEmail());
}
```

## Related

* [User](/process-functions/userSecurity-user): the user objects these methods return.
* [ApplicationTags](/process-functions/security-application-tags): gives users access tags.
