---
url: /cube-functions/userhasgroup.md
description: >-
  Returns either 1 or 0 depending on the user provided belongs to a security
  group.
---

# USERHASGROUP&#x20;

Returns either 1 or 0 depending on the user provided belongs to a security group.

```js
USERHASGROUP(group, user_id)
```

#### Parameters

* `group` - The group name.
* `user_id` - The user id. `(optional)`

#### Examples

```js
USERHASGROUP("Admin")
```

**Result:** `0`

```js
USERHASGROUP("Admin", "VARIABLE("user-id")")
```

**Result:** `0`
