Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
stable to default
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbbell committed Feb 17, 2015
2 parents 47c3872 + b351675 commit 9f970d4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/rabbit_shovel_parameters.erl
Expand Up @@ -117,11 +117,12 @@ validate_uri(Name, Term, User) ->
validate_params_user(#amqp_params_direct{}, none) ->
ok;
validate_params_user(#amqp_params_direct{virtual_host = VHost},
User = #user{username = Username,
auth_backend = M}) ->
case rabbit_vhost:exists(VHost) andalso M:check_vhost_access(User, VHost) of
true -> ok;
false -> {error, "user \"~s\" may not connect to vhost \"~s\"",
User = #user{username = Username}) ->
case rabbit_vhost:exists(VHost) andalso
(catch rabbit_access_control:check_vhost_access(
User, VHost, undefined)) of
ok -> ok;
_ -> {error, "user \"~s\" may not connect to vhost \"~s\"",
[Username, VHost]}
end;
validate_params_user(#amqp_params_network{}, _User) ->
Expand Down
2 changes: 1 addition & 1 deletion test/src/rabbit_shovel_test_dyn.erl
Expand Up @@ -257,7 +257,7 @@ invalid_param(Value) -> invalid_param(Value, none).
valid_param(Value) -> valid_param(Value, none).

lookup_user(Name) ->
{ok, User} = rabbit_auth_backend_internal:check_user_login(Name, []),
{ok, User} = rabbit_access_control:check_user_login(Name, []),
User.

clear_param(Name) ->
Expand Down

0 comments on commit 9f970d4

Please sign in to comment.