fix(authz api): fix 404 error when no have "all" rules

This commit is contained in:
zhanghongtong 2021-10-09 10:04:45 +08:00 committed by Rory Z
parent bd00c7d3c7
commit 7c28a3f6c1
1 changed files with 2 additions and 1 deletions

View File

@ -614,7 +614,8 @@ client(delete, #{bindings := #{clientid := Clientid}}) ->
all(get, _) ->
case mnesia:dirty_read(?ACL_TABLE, ?ACL_TABLE_ALL) of
[] -> {404, #{code => <<"NOT_FOUND">>, message => <<"Not Found">>}};
[] ->
{200, #{rules => []}};
[#emqx_acl{who = ?ACL_TABLE_ALL, rules = Rules}] ->
{200, #{rules => [ #{topic => Topic,
action => Action,