Skip to content

Commit

Permalink
fix TopicTabooPlugin for anonymous users
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLudwig committed Mar 10, 2021
1 parent 7cd230e commit 4a9594e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions hbmqtt/plugins/topic_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ async def topic_filtering(self, *args, **kwargs):
if filter_result:
session = kwargs.get('session', None)
topic = kwargs.get('topic', None)
if topic:
if session.username != 'admin' and topic in self._taboo:
return False
if session.username and session.username == 'admin':
return True
else:
if topic and topic in self._taboo:
return False
return True
return filter_result


Expand Down

0 comments on commit 4a9594e

Please sign in to comment.