diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2016-12-08 18:07:41 +0100 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2016-12-08 18:08:54 +0100 |
commit | a50247c20d70379e9535e5a1cd093da5c01f341a (patch) | |
tree | 38f7174abb9b277bd71e366ad3cb1ddaff54e196 | |
parent | API call does not necessary use token, it could use basic auth (diff) |
Improve handling on acl rules in api_permissions
-rw-r--r-- | src/ejabberd_access_permissions.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ejabberd_access_permissions.erl b/src/ejabberd_access_permissions.erl index 1939bcfa0..7aca2a8ef 100644 --- a/src/ejabberd_access_permissions.erl +++ b/src/ejabberd_access_permissions.erl @@ -266,7 +266,7 @@ matches_definition({_Name, {From, Who, What}}, Cmd, Module, Host, CallerInfo) -> lists:any( fun({access, Access}) when Scope == none -> acl:access_matches(Access, CallerInfo, Host) == allow; - ({acl, _} = Acl) when Scope == none -> + ({acl, Acl}) when Scope == none -> acl:acl_rule_matches(Acl, CallerInfo, Host); ({oauth, Scopes, List}) when Scope /= none -> case ejabberd_oauth:scope_in_scope_list(Scope, Scopes) of @@ -274,7 +274,7 @@ matches_definition({_Name, {From, Who, What}}, Cmd, Module, Host, CallerInfo) -> lists:any( fun({access, Access}) -> acl:access_matches(Access, CallerInfo, Host) == allow; - ({acl, _} = Acl) -> + ({acl, Acl} = Acl) -> acl:acl_rule_matches(Acl, CallerInfo, Host) end, List); _ -> @@ -407,7 +407,7 @@ parse_who(Name, Defs, ParseOauth) when is_list(Defs) -> {scope, ScopeList2} end; (Atom) when is_atom(Atom) -> - {acl, Atom}; + {acl, {acl, Atom}}; ([Other]) -> try acl:normalize_spec(Other) of Rule2 -> |