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), selectors (Added in version 7.0), databases (Added in version 9.1) and roles (Added in version 9.2). 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, channel patterns, and database permissions.
Roles are listed in the order they were assigned to the user. The
commands, keys, channels, databases and selectors fields only describe
the user’s own rules, not the permissions the user gets from its roles.
Use ACL GETROLE to inspect
the rules of a role, and ACL DRYRUN to check the
effective permissions of a user.
One of the following:
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) "nopass"
3) "passwords"
4) (empty array)
5) "commands"
6) "-@all +get"
7) "keys"
8) "~*"
9) "channels"
10) "&*"
11) "databases"
12) "alldbs"
13) "selectors"
14) 1) 1) "commands"
2) "-@all +set"
3) "keys"
4) "~key2"
5) "channels"
6) ""
7) "databases"
8) "alldbs"
15) "roles"
16) (empty array)
ACL, ACL CAT, ACL DELROLE, ACL DELUSER, ACL DIGEST, ACL DRYRUN, ACL GENPASS, ACL GETROLE, ACL HELP, ACL LIST, ACL LOAD, ACL LOG, ACL ROLES, ACL SAVE, ACL SETROLE, ACL SETUSER, ACL USERS, ACL WHOAMI, BGREWRITEAOF, BGSAVE, COMMAND, COMMAND COUNT, COMMAND DOCS, COMMAND GETKEYS, COMMAND GETKEYSANDFLAGS, COMMAND HELP, COMMAND INFO, COMMAND LIST, COMMANDLOG, COMMANDLOG GET, COMMANDLOG HELP, COMMANDLOG LEN, COMMANDLOG RESET, CONFIG, CONFIG GET, CONFIG HELP, CONFIG RESETSTAT, CONFIG REWRITE, CONFIG SET, DBSIZE, DEBUG, FAILOVER, FLUSHALL, FLUSHDB, HOTKEYS, HOTKEYS GET, HOTKEYS HELP, HOTKEYS RESET, 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.