Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Update banning users docs #2899

Merged
merged 1 commit into from
Apr 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions docs/operations/banning-users.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Follow these steps to safely ban a user from Spectrum:

1. Find the user in the database
2. Update the user with the following fields:
```
```js
r.db('spectrum')
.table('users')
.get(ID)
Expand All @@ -20,8 +20,8 @@ r.db('spectrum')
bannedReason: "Reason for ban here"
})
```
4. Remove that user as a member from all communities and channels:
```
3. Remove that user as a member from all communities and channels:
```js
// usersCommunities
.table('usersCommunities')
.getAll(ID, { index: 'userId' })
Expand All @@ -42,13 +42,43 @@ r.db('spectrum')
receiveNotifications: false,
})
```
5. Remove all notifications from threads to save worker processing:
```
4. Remove all notifications from threads to save worker processing:
```js
// usersThreads
.table('usersThreads')
.getAll(ID, { index: 'userId' })
.update({
receiveNotifications: false,
})
```
5. Reset the person's notification settings so they will not get any future emails about DMs, daily digests, etc
```js
// usersSettings
.table('usersSettings')
.getAll(ID, { index: 'userId' })
.update({
notifications: {
types: {
dailyDigest: {
email: false
},
newDirectMessage: {
email: false
},
newMention: {
email: false
},
newMessageInThreads: {
email: false
},
newThreadCreated: {
email: false
},
weeklyDigest: {
email: false
}
}
}
})
```
6. Done! The user now can't be messaged, searched for, or re-logged into. The banned user no longer affects community or channel member counts, and will not ever get pulled into Athena for notifications processing.