mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
ACL: Add hook in processCommand() to check the ACLs before call().
This commit is contained in:
parent
f95152d4c8
commit
648411eb7d
@ -2687,6 +2687,12 @@ int processCommand(client *c) {
|
||||
return C_OK;
|
||||
}
|
||||
|
||||
/* Check if the user can run this command according to the current
|
||||
* ACLs. */
|
||||
if (ACLCheckCommandPerm(c) == C_ERR) {
|
||||
addReplyErrorFormat(c,"-NOPERM this user has no permissions to run the %s command", cmd->name);
|
||||
}
|
||||
|
||||
/* Only allow a subset of commands in the context of Pub/Sub if the
|
||||
* connection is in RESP2 mode. With RESP3 there are no limits. */
|
||||
if ((c->flags & CLIENT_PUBSUB && c->resp == 2) &&
|
||||
|
Loading…
Reference in New Issue
Block a user