mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
ACL: ACLDescribeUserCommandRules(): emit subcommands.
This commit is contained in:
parent
9ae8e3fefa
commit
efce73a001
13
src/acl.c
13
src/acl.c
@ -325,6 +325,19 @@ sds ACLDescribeUserCommandRules(user *u) {
|
||||
rules = sdscatlen(rules," ",1);
|
||||
ACLSetUserCommandBit(fakeuser,cmd->id,userbit);
|
||||
}
|
||||
|
||||
/* Emit the subcommands if there are any. */
|
||||
if (userbit == 0 && u->allowed_subcommands &&
|
||||
u->allowed_subcommands[cmd->id])
|
||||
{
|
||||
for (int j = 0; u->allowed_subcommands[cmd->id][j]; j++) {
|
||||
rules = sdscatlen(rules,"+",1);
|
||||
rules = sdscat(rules,cmd->name);
|
||||
rules = sdscatlen(rules,"|",1);
|
||||
rules = sdscatsds(rules,u->allowed_subcommands[cmd->id][j]);
|
||||
rules = sdscatlen(rules," ",1);
|
||||
}
|
||||
}
|
||||
}
|
||||
dictReleaseIterator(di);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user