Skip to content

Commit

Permalink
Fix taboo topic checking without session username
Browse files Browse the repository at this point in the history
  • Loading branch information
smurfix committed Apr 14, 2019
1 parent 4bdff73 commit 8dcc234
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 @@ -26,12 +26,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 8dcc234

Please sign in to comment.