2.0 - support 'cache_acl' option
This commit is contained in:
parent
0dbbe7d0df
commit
9555b0bf05
|
@ -397,13 +397,16 @@ validate_qos(_) ->
|
|||
|
||||
%% PUBLISH ACL is cached in process dictionary.
|
||||
check_acl(publish, Topic, Client) ->
|
||||
case get({acl, publish, Topic}) of
|
||||
undefined ->
|
||||
IfCache = emqttd:conf(cache_acl, true),
|
||||
case {IfCache, get({acl, publish, Topic})} of
|
||||
{true, undefined} ->
|
||||
AllowDeny = emqttd_access_control:check_acl(Client, publish, Topic),
|
||||
put({acl, publish, Topic}, AllowDeny),
|
||||
AllowDeny;
|
||||
AllowDeny ->
|
||||
AllowDeny
|
||||
{true, AllowDeny} ->
|
||||
AllowDeny;
|
||||
{false, _} ->
|
||||
emqttd_access_control:check_acl(Client, publish, Topic)
|
||||
end;
|
||||
|
||||
check_acl(subscribe, Topic, Client) ->
|
||||
|
|
Loading…
Reference in New Issue