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 | f564c7462ddc876ca2e9c970148a29c9279c28fc (patch) | |
tree | 6f10afe374d3c90a5dfc0a6e351fab05c42fd80d | |
parent | ec7116da9649e92041d64f3fcfa2ac03d9d017ac (diff) | |
download | rabbitmq-server-f564c7462ddc876ca2e9c970148a29c9279c28fc.tar.gz |
Bring back impersonator tag.bug26098
-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 b9b39ac3..74f9cacf 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 |