commit to merge
This commit is contained in:
parent
de87edac83
commit
e858c913ce
|
@ -28,8 +28,20 @@
|
|||
|
||||
-include("emqttd.hrl").
|
||||
|
||||
-export([match/2]).
|
||||
-export([match/3]).
|
||||
|
||||
match(_Who, _Topic, []) ->
|
||||
nomatch;
|
||||
match(_Who, _Topic, [{AllowDeny, all}|_Rules]) ->
|
||||
AllowDeny;
|
||||
match(User = #mqtt_user{clientid = ClientId}, Topic, [{AllowDeny, ClientId, Filter}|Rules]) ->
|
||||
case emqttd_topic:match(Topic, Filter) of
|
||||
true -> AllowDeny;
|
||||
false -> match(User, Topic, Rules)
|
||||
end;
|
||||
match(User = #mqtt_user) ->
|
||||
|
||||
|
||||
|
||||
|
||||
match({User, Topic}, Rules) ->
|
||||
ok.
|
||||
|
||||
|
|
|
@ -86,8 +86,8 @@ start_link() ->
|
|||
check(PubSub, User, Topic) ->
|
||||
case match(User, Topic, lookup(PubSub)) of
|
||||
nomatch -> allowed;
|
||||
allowed -> allowed;
|
||||
refused -> refused
|
||||
allow -> allow;
|
||||
deny -> deny
|
||||
end.
|
||||
|
||||
lookup(PubSub) ->
|
||||
|
|
Loading…
Reference in New Issue