Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Predefined ACL rule "local". #12

wants to merge 1 commit into from

2 participants


Addition of another predefined ACL rule called "local" to match a user against either the virtual host of the match rule call, or any configured virtual host in case the rule is on the global scope.


I don't understand the practical difference between your predefined ACL rule "local" and the ACL rule included in the default ejabberd.cfg:
{acl, local, {user_regexp, ""}}.

Both have the same effect in practice, right? Otherwise, what's the benefit of using your ACL rule?


It's true that using the user regexp match rule would have the same effect, but it would be more intuitive to have this option as well. While not using anything based on the default configuration file, looking through the documentation for accurate ACL rule, I felt this option was missing.

@badlop badlop closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 27, 2011
  1. @jadahl
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/acl.erl
6 src/acl.erl
@@ -92,6 +92,8 @@ normalize_spec({A, B}) ->
{A, normalize(B)};
normalize_spec({A, B, C}) ->
{A, normalize(B), normalize(C)};
+normalize_spec(local) ->
+ local;
normalize_spec(all) ->
normalize_spec(none) ->
@@ -163,6 +165,10 @@ match_acl(ACL, JID, Host) ->
case Spec of
all ->
+ local ->
+ ((Host == Server) orelse
+ ((Host == global) andalso
+ lists:member(Server, ?MYHOSTS)));
{user, U} ->
(U == User)
Something went wrong with that request. Please try again.