acl-getuser.3valkey - Man Page
Lists the ACL rules of a user.
Synopsis
ACL GETUSER
username
Description
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.
Reply
Resp2
One of the following:
- valkey-protocol(7) Array reply: a list of ACL rule definitions for the user.
- valkey-protocol(7) Nil reply: if user does not exist.
Resp3
One of the following:
- valkey-protocol(7) Map reply: a set of ACL rule definitions for the user
- valkey-protocol(7) Null reply: if user does not exist.
Complexity
O(N). Where N is the number of password, command and pattern rules that the user has.
Acl Categories
@admin @dangerous @slow
History
- Available since: 6.0.0
- Changed in 6.2.0: Added Pub/Sub channel patterns.
- Changed in 7.0.0: Added selectors and changed the format of key and channel patterns from a list to their rule representation.
Examples
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) "&*"
See Also
acl(3valkey), acl-cat(3valkey), acl-deluser(3valkey), acl-dryrun(3valkey), acl-genpass(3valkey), acl-help(3valkey), acl-list(3valkey), acl-load(3valkey), acl-log(3valkey), acl-save(3valkey), acl-setuser(3valkey), acl-users(3valkey), acl-whoami(3valkey), bgrewriteaof(3valkey), bgsave(3valkey), command(3valkey), command-count(3valkey), command-docs(3valkey), command-getkeys(3valkey), command-getkeysandflags(3valkey), command-help(3valkey), command-info(3valkey), command-list(3valkey), config(3valkey), config-get(3valkey), config-help(3valkey), config-resetstat(3valkey), config-rewrite(3valkey), config-set(3valkey), dbsize(3valkey), debug(3valkey), failover(3valkey), flushall(3valkey), flushdb(3valkey), info(3valkey), lastsave(3valkey), latency(3valkey), latency-doctor(3valkey), latency-graph(3valkey), latency-help(3valkey), latency-histogram(3valkey), latency-history(3valkey), latency-latest(3valkey), latency-reset(3valkey), lolwut(3valkey), memory(3valkey), memory-doctor(3valkey), memory-help(3valkey), memory-malloc-stats(3valkey), memory-purge(3valkey), memory-stats(3valkey), memory-usage(3valkey), module(3valkey), module-help(3valkey), module-list(3valkey), module-load(3valkey), module-loadex(3valkey), module-unload(3valkey), monitor(3valkey), psync(3valkey), replconf(3valkey), replicaof(3valkey), restore-asking(3valkey), role(3valkey), save(3valkey), shutdown(3valkey), slowlog(3valkey), slowlog-get(3valkey), slowlog-help(3valkey), slowlog-len(3valkey), slowlog-reset(3valkey), swapdb(3valkey), sync(3valkey), time(3valkey)