default acl config

This commit is contained in:
Ery Lee 2015-04-06 14:22:27 +08:00
parent c49ac06322
commit 78e79f3279
1 changed files with 20 additions and 10 deletions

View File

@ -1,14 +1,24 @@
{allow, {ipaddr, "127.0.0.1"}, subscribe, ["$SYS/#", "#"]}. %%%-----------------------------------------------------------------------------
%%
%% [ACL Design](https://github.com/emqtt/emqttd/wiki/ACL-Design)
%%
%% -type who() :: all | binary() |
%% {ipaddr, esockd_access:cidr()} |
%% {client, binary()} |
%% {user, binary()}.
%%
%% -type access() :: subscribe | publish | pubsub.
%%
%% -type topic() :: binary().
%%
%% -type rule() :: {allow, all} |
%% {allow, who(), access(), list(topic())} |
%% {deny, all} |
%% {deny, who(), access(), list(topic())}.
%%
%%%-----------------------------------------------------------------------------
{allow, {user, "testuser"}, subscribe, ["a/b/c", "d/e/f/#"]}. {allow, {ipaddr, "127.0.0.1"}, pubsub, ["$SYS/#", "#"]}.
{allow, {user, "admin"}, pubsub, ["a/b/c", "d/e/f/#"]}.
{allow, {client, "testClient"}, subscribe, ["testTopics/testClient"]}.
{allow, all, subscribe, ["clients/$c"]}.
{allow, all, subscribe, ["users/$u/#"]}.
{deny, all, subscribe, ["$SYS/#", "#"]}. {deny, all, subscribe, ["$SYS/#", "#"]}.