added "test" permission check #244

This commit is contained in:
Tomaae 2022-09-05 21:11:03 +02:00
parent fd0689bf4c
commit 385092a513
No known key found for this signature in database
GPG key ID: 8360BBD8A381D1C0

View file

@ -543,6 +543,9 @@ class MikrotikControllerData:
if not self.option_track_network_hosts: if not self.option_track_network_hosts:
return return
if "test" not in self.data["access"]:
return
try: try:
await asyncio.wait_for(self.lock_ping.acquire(), timeout=3) await asyncio.wait_for(self.lock_ping.acquire(), timeout=3)
except Exception: except Exception:
@ -728,6 +731,7 @@ class MikrotikControllerData:
"write" not in self.data["access"] "write" not in self.data["access"]
or "policy" not in self.data["access"] or "policy" not in self.data["access"]
or "reboot" not in self.data["access"] or "reboot" not in self.data["access"]
or "test" not in self.data["access"]
): ):
_LOGGER.warning( _LOGGER.warning(
"Mikrotik %s user %s does not have sufficient access rights. Integration functionality will be limited.", "Mikrotik %s user %s does not have sufficient access rights. Integration functionality will be limited.",