mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
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:
parent
b703b4f022
commit
ca0dd09944
1 changed files with 2 additions and 0 deletions
|
@ -818,6 +818,8 @@ get_exposed_commands(Version) ->
|
||||||
Cmds.
|
Cmds.
|
||||||
|
|
||||||
%% This is used to allow mixing command policy (like open, user, admin, restricted), with command entry
|
%% 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) ->
|
expand_commands(L, OpenCmds, UserCmds, AdminCmds, RestrictedCmds) when is_list(L) ->
|
||||||
lists:foldl(fun(open, Acc) -> OpenCmds ++ Acc;
|
lists:foldl(fun(open, Acc) -> OpenCmds ++ Acc;
|
||||||
(user, Acc) -> UserCmds ++ Acc;
|
(user, Acc) -> UserCmds ++ Acc;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue