# ACL GETUSER

> Show one ACL user's flags, password hashes, command rules, key and channel patterns, and selectors.

URL: https://docs.hotkv.com/commands/acl-getuser/

```
ACL GETUSER username
```

- Group: ACL
- Complexity: O(N) where N is the number of rules of the user
- HotKV Cloud: all plans
- On-Premise: no license needed

`ACL GETUSER` describes one user. It is the structured counterpart of the
user's line in [ACL LIST](https://docs.hotkv.com/commands/acl-list/index.md), and is handy for checking
what a series of [ACL SETUSER](https://docs.hotkv.com/commands/acl-setuser/index.md) calls produced.

## Return value

Nil (RESP2) or null (RESP3) when the user does not exist. Otherwise a map in
RESP3, or a flat array of field and value pairs in RESP2, with these fields:

| Field | Value |
| --- | --- |
| `flags` | Set (array in RESP2): `on` or `off`, `nopass` when set, and `sanitize-payload` or `skip-sanitize-payload` |
| `passwords` | Array of the SHA-256 hashes of the user's passwords, in hex |
| `commands` | Bulk string: the command rules, starting with `+@all` or `-@all` |
| `keys` | Bulk string: the key patterns (`~pattern`, `%R~pattern`, `%W~pattern`), `~*` for all keys |
| `channels` | Bulk string: the channel patterns (`&pattern`), `&*` for all channels |
| `selectors` | Array of maps (flat arrays in RESP2), one per selector, each with `commands`, `keys` and `channels` |

Passwords themselves are never shown, only their hashes.

## Examples

```
127.0.0.1:6379> ACL SETUSER alice on >s3cret ~app:* %R~shared:* &news:* -@all +@read +set
OK
127.0.0.1:6379> ACL GETUSER alice
 1) "flags"
 2) 1) "on"
    2) "sanitize-payload"
 3) "passwords"
 4) 1) "1ec1c26b50d5d3c58d9583181af8076655fe00756bf7285940ba3670f99fcba0"
 5) "commands"
 6) "-@all +@read +set"
 7) "keys"
 8) "~app:* %R~shared:*"
 9) "channels"
10) "&news:*"
11) "selectors"
12) (empty array)
127.0.0.1:6379> ACL GETUSER nosuchuser
(nil)
```

## Compatibility

Same fields and order as Redis 7 and Valkey 8.

## See also

[ACL SETUSER](https://docs.hotkv.com/commands/acl-setuser/index.md), [ACL LIST](https://docs.hotkv.com/commands/acl-list/index.md),
[ACL DRYRUN](https://docs.hotkv.com/commands/acl-dryrun/index.md)