summaryrefslogtreecommitdiff
path: root/src/multi.c
diff options
context:
space:
mode:
authorYaacovHazan <31382944+YaacovHazan@users.noreply.github.com>2021-09-23 08:52:56 +0300
committerGitHub <noreply@github.com>2021-09-23 08:52:56 +0300
commita56d4533b72db8aa147be090c4c1d2bc548b9408 (patch)
tree718d3628bcdb7ca5132324af33b841cb0d1aeeec /src/multi.c
parent14d6abd8e9a928aa920d5009d79e7b8ff2d0d5ba (diff)
downloadredis-a56d4533b72db8aa147be090c4c1d2bc548b9408.tar.gz
Adding ACL support for modules (#9309)
This commit introduced a new flag to the RM_Call: 'C' - Check if the command can be executed according to the ACLs associated with it. Also, three new API's added to check if a command, key, or channel can be executed or accessed by a user, according to the ACLs associated with it. - RM_ACLCheckCommandPerm - RM_ACLCheckKeyPerm - RM_ACLCheckChannelPerm The user for these API's is a RedisModuleUser object, that for a Module user returned by the RM_CreateModuleUser API, or for a general ACL user can be retrieved by these two new API's: - RM_GetCurrentUserName - Retrieve the user name of the client connection behind the current context. - RM_GetModuleUserFromUserName - Get a RedisModuleUser from a user name As a result of getting a RedisModuleUser from name, it can now also access the general ACL users (not just ones created by the module). This mean the already existing API RM_SetModuleUserACL(), can be used to change the ACL rules for such users.
Diffstat (limited to 'src/multi.c')
-rw-r--r--src/multi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/multi.c b/src/multi.c
index 5c229d11b..e40d2a447 100644
--- a/src/multi.c
+++ b/src/multi.c
@@ -228,7 +228,7 @@ void execCommand(client *c) {
reason = "no permission";
break;
}
- addACLLogEntry(c,acl_retval,acl_errpos,NULL);
+ addACLLogEntry(c,acl_retval,ACL_LOG_CTX_MULTI,acl_errpos,NULL,NULL);
addReplyErrorFormat(c,
"-NOPERM ACLs rules changed between the moment the "
"transaction was accumulated and the EXEC call. "