]> granicus.if.org Git - ejabberd/commitdiff
Accept "add_commands: admin" in commands section not only "add_commands: - admin"
authorPaweł Chmielowski <pchmielowski@process-one.net>
Mon, 6 Feb 2017 20:40:37 +0000 (21:40 +0100)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Mon, 6 Feb 2017 20:40:37 +0000 (21:40 +0100)
This fixes issue reported in #1518, and restores compatibility with
what older version were accepting and what is documented.

src/ejabberd_commands.erl

index 4ba38a559abed634b53a67a480f94133eb65d68d..9491288f987cf6f0c19b8f5ee046d059ee3b8400 100644 (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;