acl.conf 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. %%--------------------------------------------------------------------
  2. %% -type(ipaddr() :: {ipaddr, string()}).
  3. %%
  4. %% -type(ipaddrs() :: {ipaddrs, [string()]}).
  5. %%
  6. %% -type(username() :: {user | username, string()} | {user | username, {re, regex()}}).
  7. %%
  8. %% -type(clientid() :: {client | clientid, string()} | {client | clientid, {re, regex()}}).
  9. %%
  10. %% -type(who() :: ipaddr() | ipaddrs() | username() | clientid() |
  11. %% {'and', [ipaddr() | ipaddrs() | username() | clientid()]} |
  12. %% {'or', [ipaddr() | ipaddrs() | username() | clientid()]} |
  13. %% all).
  14. %%
  15. %% -type(action() :: subscribe | publish | all).
  16. %%
  17. %% -type(topic_filters() :: string()).
  18. %%
  19. %% -type(topics() :: [topic_filters() | {eq, topic_filters()}]).
  20. %%
  21. %% -type(permission() :: allow | deny).
  22. %%
  23. %% -type(rule() :: {permission(), who(), action(), topics()} | {permission(), all}).
  24. %%--------------------------------------------------------------------
  25. {allow, {username, {re, "^dashboard$"}}, subscribe, ["$SYS/#"]}.
  26. {allow, {ipaddr, "127.0.0.1"}, all, ["$SYS/#", "#"]}.
  27. {deny, all, subscribe, ["$SYS/#", {eq, "#"}]}.
  28. {allow, all}.