summaryrefslogtreecommitdiff
path: root/test/acl_test.exs
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2016-06-24 15:09:51 +0200
committerPaweł Chmielowski <pchmielowski@process-one.net>2016-06-24 15:09:51 +0200
commitf56cff925c23e8205034ddef18e6dfece95fb01f (patch)
tree01d955af0dde7a47c1e2f599f90be7bdfed7cdae /test/acl_test.exs
parentUpdate dependencies for 16.06x (diff)
acl: ACLName rule should match if any part of ACLName matches
Diffstat (limited to 'test/acl_test.exs')
-rw-r--r--test/acl_test.exs4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/acl_test.exs b/test/acl_test.exs
index 39894343..551c74ae 100644
--- a/test/acl_test.exs
+++ b/test/acl_test.exs
@@ -36,13 +36,17 @@ defmodule ACLTest do
test "access rule match with user part ACL" do
:acl.add(:global, :basic_acl_1, {:user, "test1"})
+ :acl.add(:global, :basic_acl_1, {:user, "test2"})
:acl.add_access(:global, :basic_rule_1, [{:allow, [{:acl, :basic_acl_1}]}])
# JID can only be passes as jid record.
# => TODO: Support passing JID as binary.
assert :acl.match_rule(:global, :basic_rule_1, :jid.from_string("test1@domain1")) == :allow
assert :acl.match_rule(:global, :basic_rule_1, :jid.from_string("test1@domain2")) == :allow
+ assert :acl.match_rule(:global, :basic_rule_1, :jid.from_string("test2@domain1")) == :allow
+ assert :acl.match_rule(:global, :basic_rule_1, :jid.from_string("test2@domain2")) == :allow
# We match on user part only for local domain. As an implicit rule remote domain are not matched
assert :acl.match_rule(:global, :basic_rule_1, :jid.from_string("test1@otherdomain")) == :deny
+ assert :acl.match_rule(:global, :basic_rule_1, :jid.from_string("test2@otherdomain")) == :deny
assert :acl.match_rule(:global, :basic_rule_1, :jid.from_string("test11@domain1")) == :deny
:acl.add(:global, :basic_acl_2, {:user, {"test2", "domain1"}})