Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: notify when a user account is deleted#14113

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 8 commits intomainfrom17-account-delete
Aug 2, 2024
Merged

Conversation

mtojek
Copy link
Member

Related:coder/internal#17

This PR extendsapi.deleteUser to notify owners and user admins when somebody deletes a new user.

@mtojekmtojek self-assigned thisAug 2, 2024
@mtojekmtojek changed the titlefeat: notify about deleted user accountfeat: notify when a user account is deletedAug 2, 2024
@mtojekmtojek mentioned this pull requestAug 2, 2024
5 tasks
@mtojekmtojek marked this pull request as ready for reviewAugust 2, 2024 11:15
Copy link
Contributor

@dannykoppingdannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good stuff, a couple things I think we need to consider before merging though.

iferr!=nil {
returnnil,xerrors.Errorf("get owners: %w",err)
}
userAdmins,err:=store.GetUsers(ctx, database.GetUsersParams{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we also need to include org user admins here?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Probably, I will leave it as a follow-up once the org part is final. Most likely we need to adjustcreate account logic too.

// then
require.Len(t,notifyEnq.Sent,2)
// notifyEnq.Sent[0] is create account event
require.Equal(t,notifications.TemplateUserAccountDeleted,notifyEnq.Sent[1].TemplateID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should the owner receive an email for their own action?
We're suppressing this for users who delete their own workspaces, for example, so I wonder if we should follow the same pattern. Possible follow-up though, non-blocking.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You can't delete your own account, so I believe there is no need to filter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What i mean is: if an owner initiated an event - they should probably not receive a notification about it because it's redundant.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I understand that they won't receive as the API method will fail faster? seecode

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oh.. you mean the owner of the action.. not the owner of the account. Interesting case, on the other hand, if somebody took over the account, notifications would work like auditing.

@mtojekmtojek merged commit6428a76 intomainAug 2, 2024
@mtojekmtojek deleted the 17-account-delete branchAugust 2, 2024 12:56
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 2, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@dannykoppingdannykoppingdannykopping approved these changes

Assignees

@mtojekmtojek

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@mtojek@dannykopping

[8]ページ先頭

©2009-2025 Movatter.jp