Merge pull request #10172 from HJianBo/fix-typos-acl-file

fix(acl): fix wrong default ACL rules
This commit is contained in:
JianBo He 2023-03-27 09:51:02 +08:00 committed by GitHub
commit b77aeb69cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -23,7 +23,7 @@
%% -type(rule() :: {permission(), who(), access(), topics()} | {permission(), all}). %% -type(rule() :: {permission(), who(), access(), topics()} | {permission(), all}).
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
{allow, {username, "^dashboard?"}, subscribe, ["$SYS/#"]}. {allow, {username, {re, "^dashboard$"}}, subscribe, ["$SYS/#"]}.
{allow, {ipaddr, "127.0.0.1"}, all, ["$SYS/#", "#"]}. {allow, {ipaddr, "127.0.0.1"}, all, ["$SYS/#", "#"]}.

View File

@ -0,0 +1,9 @@
Fix the incorrect default ACL rule, which was:
```
{allow, {username, "^dashboard?"}, subscribe, ["$SYS/#"]}.
```
However, it should use `{re, "^dashboard$"}` to perform a regular expression match:
```
{allow, {username, {re,"^dashboard$"}}, subscribe, ["$SYS/#"]}.
```

View File

@ -0,0 +1,8 @@
修复错误的默认 ACL 规则,之前是:
```
{allow, {username, "^dashboard?"}, subscribe, ["$SYS/#"]}.
```
但执行正则表达式的匹配应该使用 `{re, "^dashboard$"}`
```
{allow, {username, {re, "^dashboard$"}}, subscribe, ["$SYS/#"]}.
```