# Who may publish and read what on the desktop Edge broker. One user per
# service; start.sh makes the password file from .env. A user with no line
# for a topic has no access to it. Ported from
# infrastructure/compose/config/mosquitto/acl.
#
# Mosquitto does not report a refused action to the client: it acks a
# denied SUBSCRIBE or QoS 1 PUBLISH and then delivers nothing. Test a change
# by the messages that arrive, not by the acks.

# Every user may read application events unless a `topic deny` line says no.
# A persistent session made before the broker had passwords has no user
# name; only a `pattern` line matches it. Without this line the broker drops
# the events queued for that session after the upgrade.
pattern read application/+/device/+/event/+

user chirpstack
topic write application/+/device/+/event/+
topic read application/+/device/+/command/+
topic read us915_0/gateway/+/event/+
topic read us915_0/gateway/+/state/+
topic write us915_0/gateway/+/command/+

user gateway-bridge
topic write us915_0/gateway/+/event/+
topic write us915_0/gateway/+/state/+
topic read us915_0/gateway/+/command/#
topic deny application/#

user lora
topic read application/+/device/+/event/up

user modbus
topic read application/+/device/+/event/up

user bacnet
topic read application/+/device/+/event/up
