Skip to content

Support for resetchannels since Redis 6.2.0 #2514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 26, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def acl_setuser(
selectors: Optional[Iterable[Tuple[str, KeyT]]] = None,
reset: bool = False,
reset_keys: bool = False,
reset_channels: bool = False,
reset_passwords: bool = False,
**kwargs,
) -> ResponseT:
Expand Down Expand Up @@ -248,6 +249,12 @@ def acl_setuser(
key permissions will be kept and any new specified key permissions
will be applied on top.

``reset_channels`` is a boolean indicating whether the user's channel
permissions should be reset prior to applying any new channel permissions
specified in ``channels``.If this is False, the user's existing
channel permissions will be kept and any new specified channel permissions
will be applied on top.

``reset_passwords`` is a boolean indicating whether to remove all
existing passwords and the 'nopass' flag from the user prior to
applying any new passwords specified in 'passwords' or
Expand All @@ -266,6 +273,9 @@ def acl_setuser(
if reset_keys:
pieces.append(b"resetkeys")

if reset_channels:
pieces.append(b"resetchannels")

if reset_passwords:
pieces.append(b"resetpass")

Expand Down