Fix acl bug in subscribe

This commit is contained in:
周子博 2019-03-28 13:56:25 +08:00 committed by tigercl
parent 7baa317d55
commit f14a56eb17
1 changed files with 1 additions and 1 deletions

View File

@ -863,7 +863,7 @@ check_sub_acl(TopicFilters, #pstate{credentials = #{is_superuser := IsSuper}, en
check_sub_acl(TopicFilters, #pstate{credentials = Credentials}) ->
lists:foldr(
fun({Topic, SubOpts}, {Ok, Acc}) ->
case emqx_access_control:check_acl(Credentials, publish, Topic) of
case emqx_access_control:check_acl(Credentials, subscribe, Topic) of
allow -> {Ok, [{Topic, SubOpts}|Acc]};
deny ->
{error, [{Topic, SubOpts#{rc := ?RC_NOT_AUTHORIZED}}|Acc]}