Skip to content

Commit

Permalink
only log if the permission is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
kickster97 committed Dec 5, 2023
1 parent f132fb9 commit 887a3cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lavinmq/user_store.cr
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ module LavinMQ

def add_permission(user, vhost, config, read, write)
perm = {config: config, read: read, write: write}
unless perm == @users[user].permissions[vhost]
Log.info { "Updated permissions for user=#{user} on vhost=#{vhost}" }
end
@users[user].permissions[vhost] = perm
@users[user].invalidate_acl_caches
Log.info { "Updated permissions for user=#{user} on vhost=#{vhost}" }
save!
perm
end
Expand Down

0 comments on commit 887a3cc

Please sign in to comment.