Accept "add_commands: admin" in commands section not only "add_commands: - admin"

This fixes issue reported in #1518, and restores compatibility with
what older version were accepting and what is documented.
This commit is contained in:
Paweł Chmielowski 2017-02-06 21:40:37 +01:00
parent b703b4f022
commit ca0dd09944
1 changed files with 2 additions and 0 deletions

View File

@ -818,6 +818,8 @@ get_exposed_commands(Version) ->
Cmds.
%% This is used to allow mixing command policy (like open, user, admin, restricted), with command entry
expand_commands(L, OpenCmds, UserCmds, AdminCmds, RestrictedCmds) when is_atom(L) ->
expand_commands([L], OpenCmds, UserCmds, AdminCmds, RestrictedCmds);
expand_commands(L, OpenCmds, UserCmds, AdminCmds, RestrictedCmds) when is_list(L) ->
lists:foldl(fun(open, Acc) -> OpenCmds ++ Acc;
(user, Acc) -> UserCmds ++ Acc;