Mercurial > prosody-hg
comparison core/usermanager.lua @ 13680:22f1444f08f9 13.0
usermanager: Include role_name in event for consistency with the 'removed' event
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 13 Feb 2025 15:31:37 +0000 |
| parents | 1796370091d4 |
| children | b5b0190ddc38 |
comparison
equal
deleted
inserted
replaced
| 13679:f5c7fe7bbe3b | 13680:22f1444f08f9 |
|---|---|
| 242 if type(user) ~= "string" then return false; end | 242 if type(user) ~= "string" then return false; end |
| 243 | 243 |
| 244 local role, err = hosts[host].authz.add_user_secondary_role(user, role_name); | 244 local role, err = hosts[host].authz.add_user_secondary_role(user, role_name); |
| 245 if role then | 245 if role then |
| 246 prosody.events.fire_event("user-role-added", { | 246 prosody.events.fire_event("user-role-added", { |
| 247 username = user, host = host, role = role; | 247 username = user, host = host, role_name = role_name, role = role; |
| 248 }); | 248 }); |
| 249 end | 249 end |
| 250 return role, err; | 250 return role, err; |
| 251 end | 251 end |
| 252 | 252 |
