diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-04-04 13:47:50 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-04-04 13:47:50 +0100 |
| commit | 98d272508e4c9760bb66e010c8a6f8b10f0dda70 (patch) | |
| tree | 6f10afe374d3c90a5dfc0a6e351fab05c42fd80d /src | |
| parent | 930a5a62228de03ac5e2eed8fe2b895f348e768a (diff) | |
| download | rabbitmq-server-git-98d272508e4c9760bb66e010c8a6f8b10f0dda70.tar.gz | |
Bring back impersonator tag.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_channel.erl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index b9b39ac308..74f9cacf76 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -504,10 +504,14 @@ check_user_id_header( #'P_basic'{}, #ch{user = #user{auth_backend = rabbit_auth_backend_dummy}}) -> ok; check_user_id_header(#'P_basic'{user_id = Claimed}, - #ch{user = #user{username = Actual}}) -> - precondition_failed( - "user_id property set to '~s' but authenticated user was '~s'", - [Claimed, Actual]). + #ch{user = #user{username = Actual, + tags = Tags}}) -> + case lists:member(impersonator, Tags) of + true -> ok; + false -> precondition_failed( + "user_id property set to '~s' but authenticated user was " + "'~s'", [Claimed, Actual]) + end. check_expiration_header(Props) -> case rabbit_basic:parse_expiration(Props) of |
