Use ACL GETUSER to inspect the resulting permissions of a single ACL user, broken out into structured fields instead of the raw rule string that ACL LIST returns.
The reply describes the user's on/off and other flags, its passwords, the commands it can call as a single space-separated permission string, the key patterns it can access, and the channel patterns it can publish to or subscribe on. A username that does not exist returns a null reply rather than an error, which makes this command a convenient way to check whether a user exists before creating or modifying it.
Syntax#
Arguments#
| Argument | Required | Repeatable | Description |
|---|---|---|---|
username | Yes | No | ACL user to inspect. |
Important points#
- Returns null when the given username does not exist, instead of an error.
- The reply has five fields:
flags,passwords,commands,keys, andchannels. Standard Redis 7+ also returns aselectorsfield; this deployment does not support selectors, so client libraries that expect one will simply receive an empty or undefined value for it.
Response#
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.
| Protocol | Reply |
|---|---|
| RESP2 | Flat array of alternating field names and values, with nested arrays for flags, passwords, keys, and channels; or Null array |
| RESP3 | Map of five fields, with a Set for flags and Arrays for passwords, keys, and channels; or Null |
Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples#
TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
Redis CLI
@upstash/redis
This command is not supported yet in @upstash/redis.
upstash_redis
This command is not supported yet in upstash_redis.
ioredis
node-redis
redis-py
go-redis
go-redis has no typed ACLGetUser method; call ACL GETUSER through Do.