-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect event fired when clear_topic_permissions executed #9937
Comments
Your findings are correct, in fact, another function head already uses clear_topic_permissions(Username, VirtualHost, ActingUser) ->
rabbit_log:debug("Asked to clear topic permissions for user '~ts' in virtual host '~ts'",
[Username, VirtualHost]),
try
R = rabbit_db_user:clear_topic_permissions(Username, VirtualHost, '_'),
rabbit_log:info("Successfully cleared topic permissions for user '~ts' in virtual host '~ts'",
[Username, VirtualHost]),
rabbit_event:notify(topic_permission_deleted, [{user, Username},
{vhost, VirtualHost},
{user_who_performed_action, ActingUser}]),
R
catch
Class:Error:Stacktrace ->
rabbit_log:warning("Failed to clear topic permissions for user '~ts' in virtual host '~ts': ~tp",
[Username, VirtualHost, Error]),
erlang:raise(Class, Error, Stacktrace)
end.
clear_topic_permissions(Username, VirtualHost, Exchange, ActingUser) ->
rabbit_log:debug("Asked to clear topic permissions on exchange '~ts' for user '~ts' in virtual host '~ts'",
[Exchange, Username, VirtualHost]),
try
R = rabbit_db_user:clear_topic_permissions(
Username, VirtualHost, Exchange),
rabbit_log:info("Successfully cleared topic permissions on exchange '~ts' for user '~ts' in virtual host '~ts'",
[Exchange, Username, VirtualHost]),
rabbit_event:notify(permission_deleted, [{user, Username},
{vhost, VirtualHost},
{user_who_performed_action, ActingUser}]),
R
catch
Class:Error:Stacktrace ->
rabbit_log:warning("Failed to clear topic permissions on exchange '~ts' for user '~ts' in virtual host '~ts': ~tp",
[Exchange, Username, VirtualHost, Error]),
erlang:raise(Class, Error, Stacktrace)
end. Thank you! |
Merged
michaelklishin
added a commit
that referenced
this issue
Nov 17, 2023
ahh, cool. thx :) |
just a note, is there reason why you did not put exchange name into event data? |
michaelklishin
added a commit
that referenced
this issue
Nov 17, 2023
michaelklishin
added a commit
that referenced
this issue
Nov 17, 2023
Add #9937 to 3.12.9 release notes
mergify bot
pushed a commit
that referenced
this issue
Nov 17, 2023
(cherry picked from commit e4215d9)
@bedla no particular reason |
could you add there that info? or I can prepare PR (but not having toolchain ready to test it) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Hi,
I found out that when I delete topic permissions
permission.deleted
event is fired instead oftopic.permission.deleted
.I am not Erlang developer, but it looks like that problem is in this method https://github.com/rabbitmq/rabbitmq-server/blob/v3.13.0-rc.2/deps/rabbit/src/rabbit_auth_backend_internal.erl#L626-L643
And it should be fixed to something similar to this snippet:
What do you think? Is it bug or am I missing something?
Thx
Ivos
Reproduction steps
Expected behavior
topic.permission.deleted
event is firedAdditional context
No response
The text was updated successfully, but these errors were encountered: