fix(emqx_acl_mnesia): Dialyzer warnings
This commit is contained in:
parent
b08d9d5d9b
commit
5644fdc1f0
|
@ -151,7 +151,7 @@ do_add(Params) ->
|
||||||
Action = urldecode(get_value(<<"action">>, Params)),
|
Action = urldecode(get_value(<<"action">>, Params)),
|
||||||
Access = urldecode(get_value(<<"access">>, Params)),
|
Access = urldecode(get_value(<<"access">>, Params)),
|
||||||
Re = case validate([login, topic, action, access], [Login, Topic, Action, Access]) of
|
Re = case validate([login, topic, action, access], [Login, Topic, Action, Access]) of
|
||||||
ok ->
|
ok ->
|
||||||
emqx_acl_mnesia_cli:add_acl(Login, Topic, erlang:binary_to_atom(Action, utf8), erlang:binary_to_atom(Access, utf8));
|
emqx_acl_mnesia_cli:add_acl(Login, Topic, erlang:binary_to_atom(Action, utf8), erlang:binary_to_atom(Access, utf8));
|
||||||
Err -> Err
|
Err -> Err
|
||||||
end,
|
end,
|
||||||
|
@ -163,7 +163,7 @@ do_add(Params) ->
|
||||||
all -> #{all => '$all'};
|
all -> #{all => '$all'};
|
||||||
_ -> maps:from_list([Login])
|
_ -> maps:from_list([Login])
|
||||||
end).
|
end).
|
||||||
|
|
||||||
delete(#{clientid := Clientid, topic := Topic}, _) ->
|
delete(#{clientid := Clientid, topic := Topic}, _) ->
|
||||||
return(emqx_acl_mnesia_cli:remove_acl({clientid, urldecode(Clientid)}, urldecode(Topic)));
|
return(emqx_acl_mnesia_cli:remove_acl({clientid, urldecode(Clientid)}, urldecode(Topic)));
|
||||||
delete(#{username := Username, topic := Topic}, _) ->
|
delete(#{username := Username, topic := Topic}, _) ->
|
||||||
|
@ -202,12 +202,6 @@ do_validation(login, {clientid, V}) when is_binary(V)
|
||||||
do_validation(login, {username, V}) when is_binary(V)
|
do_validation(login, {username, V}) when is_binary(V)
|
||||||
andalso byte_size(V) > 0->
|
andalso byte_size(V) > 0->
|
||||||
true;
|
true;
|
||||||
do_validation(clientid, V) when is_binary(V)
|
|
||||||
andalso byte_size(V) > 0 ->
|
|
||||||
true;
|
|
||||||
do_validation(username, V) when is_binary(V)
|
|
||||||
andalso byte_size(V) > 0 ->
|
|
||||||
true;
|
|
||||||
do_validation(topic, V) when is_binary(V)
|
do_validation(topic, V) when is_binary(V)
|
||||||
andalso byte_size(V) > 0 ->
|
andalso byte_size(V) > 0 ->
|
||||||
true;
|
true;
|
||||||
|
|
Loading…
Reference in New Issue