Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
efce73a0
Commit
efce73a0
authored
Jan 30, 2019
by
antirez
Browse files
ACL: ACLDescribeUserCommandRules(): emit subcommands.
parent
9ae8e3fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
efce73a0
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment