summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorArnaud Cogoluègnes <acogoluegnes@gmail.com>2016-12-29 08:49:34 +0100
committerArnaud Cogoluègnes <acogoluegnes@gmail.com>2016-12-29 08:49:34 +0100
commitcf259df33dc27b9ca99682cdccc1067eb76fd808 (patch)
tree6d2ecf3ca87ef5bc83967ed32b1cbed08e965fb2 /test
parent0876ac25d41a647b2f0af5fa186e530ea68b39ef (diff)
downloadrabbitmq-server-git-cf259df33dc27b9ca99682cdccc1067eb76fd808.tar.gz
Create topic permission table in upgrades
References #505
Diffstat (limited to 'test')
-rw-r--r--test/topic_permission_SUITE.erl24
1 files changed, 14 insertions, 10 deletions
diff --git a/test/topic_permission_SUITE.erl b/test/topic_permission_SUITE.erl
index f408e854d4..2d36cc8551 100644
--- a/test/topic_permission_SUITE.erl
+++ b/test/topic_permission_SUITE.erl
@@ -189,32 +189,36 @@ topic_permission_checks(_Config) ->
User = #auth_user{username = <<"guest">>},
Topic = #resource{name = <<"amq.topic">>, virtual_host = <<"/">>,
- options = #{routing_key => <<"a.b.c">>},
kind = topic},
+ Context = #{routing_key => <<"a.b.c">>},
%% user has access to exchange, routing key matches
- true = rabbit_auth_backend_internal:check_resource_access(
+ true = rabbit_auth_backend_internal:check_topic_access(
User,
Topic,
- write
+ write,
+ Context
),
%% user has access to exchange, routing key does not match
- false = rabbit_auth_backend_internal:check_resource_access(
+ false = rabbit_auth_backend_internal:check_topic_access(
User,
- Topic#resource{options = #{routing_key => <<"x.y.z">>}},
- write
+ Topic,
+ write,
+ #{routing_key => <<"x.y.z">>}
),
%% user has access to exchange but not on this vhost
%% let pass when there's no match
- true = rabbit_auth_backend_internal:check_resource_access(
+ true = rabbit_auth_backend_internal:check_topic_access(
User,
Topic#resource{virtual_host = <<"fancyvhost">>},
- write
+ write,
+ Context
),
%% user does not have access to exchange
%% let pass when there's no match
- true = rabbit_auth_backend_internal:check_resource_access(
+ true = rabbit_auth_backend_internal:check_topic_access(
#auth_user{username = <<"dummy">>},
Topic,
- write
+ write,
+ Context
),
ok. \ No newline at end of file