refactor(core): Add telemetry for RBAC roles (#7969)

Add telemetry for RBAC roles, see
[requirements](https://linear.app/n8n/issue/PAY-1067/add-telemetry-events-for-adding-and-assigning-admin-users#comment-184619fe).
This commit is contained in:
Iván Ovejero
2023-12-13 12:22:11 +01:00
committed by GitHub
parent 8f364087c9
commit a70a5076ee
4 changed files with 39 additions and 2 deletions

View File

@@ -391,6 +391,13 @@ export class UsersController {
await this.userService.update(targetUser.id, { globalRole: roleToSet });
void this.internalHooks.onUserRoleChange({
user: req.user,
target_user_id: targetUser.id,
target_user_new_role: [newRole.scope, newRole.name].join(' '),
public_api: false,
});
return { success: true };
}
}