Lists the ACL rules of a user.
ACL
GETUSER
username
The command returns all the rules defined for an existing ACL user.
Specifically, it lists the user’s ACL flags, password hashes, commands, key patterns, channel patterns (Added in version 6.2) and selectors (Added in version 7.0). Additional information may be returned in the future if more metadata is added to the user.
Command rules are always returned in the same format as the one used
in the ACL SETUSER
command. Before version 7.0, keys and
channels were returned as an array of patterns, however in version 7.0
later they are now also returned in same format as the one used in the
ACL SETUSER
command. Note: This description of command
rules reflects the user’s effective permissions, so while it may not be
identical to the set of rules used to configure the user, it is still
functionally identical.
Selectors are listed in the order they were applied to the user, and include information about commands, key patterns, and channel patterns.
One of the following:
Array reply: a list of ACL rule definitions for the user.
Nil reply: if user does not exist.
One of the following:
Map reply: a set of ACL rule definitions for the user
Null reply: if user does not exist.
O(N). Where N is the number of password, command and pattern rules that the user has.
@admin @dangerous @slow
Here’s an example configuration for a user
127.0.0.1:6379> ACL SETUSER sample on nopass +GET allkeys &* (+SET ~key2)
"OK"
127.0.0.1:6379> ACL GETUSER sample
1) "flags"
2) 1) "on"
2) "allkeys"
3) "nopass"
3) "passwords"
4) (empty array)
5) "commands"
6) "+@all"
7) "keys"
8) "~*"
9) "channels"
10) "&*"
11) "selectors"
12) 1) 1) "commands"
6) "+SET"
7) "keys"
8) "~key2"
9) "channels"
10) "&*"
ACL, ACL CAT, ACL DELUSER, ACL DRYRUN, ACL GENPASS, ACL HELP, ACL LIST, ACL LOAD, ACL LOG, ACL SAVE, ACL SETUSER, ACL USERS, ACL WHOAMI, BGREWRITEAOF, BGSAVE, COMMAND, COMMAND COUNT, COMMAND DOCS, COMMAND GETKEYS, COMMAND GETKEYSANDFLAGS, COMMAND HELP, COMMAND INFO, COMMAND LIST, CONFIG, CONFIG GET, CONFIG HELP, CONFIG RESETSTAT, CONFIG REWRITE, CONFIG SET, DBSIZE, DEBUG, FAILOVER, FLUSHALL, FLUSHDB, INFO, LASTSAVE, LATENCY, LATENCY DOCTOR, LATENCY GRAPH, LATENCY HELP, LATENCY HISTOGRAM, LATENCY HISTORY, LATENCY LATEST, LATENCY RESET, LOLWUT, MEMORY, MEMORY DOCTOR, MEMORY HELP, MEMORY MALLOC-STATS, MEMORY PURGE, MEMORY STATS, MEMORY USAGE, MODULE, MODULE HELP, MODULE LIST, MODULE LOAD, MODULE LOADEX, MODULE UNLOAD, MONITOR, PSYNC, REPLCONF, REPLICAOF, RESTORE-ASKING, ROLE, SAVE, SHUTDOWN, SLOWLOG, SLOWLOG GET, SLOWLOG HELP, SLOWLOG LEN, SLOWLOG RESET, SWAPDB, SYNC, TIME.