Implement user suspension #876
No reviewers
Labels
No labels
Bug
Cherry-picking
Database
Dependencies
Difficulty
Easy
Difficulty
Hard
Difficulty
Medium
Documentation
Enhancement
Good first issue
Help wanted
Inherited
Matrix/Administration
Matrix/Appservices
Matrix/Auth
Matrix/Client
Matrix/Core
Matrix/Federation
Matrix/MSC
Matrix/Media
Meta
Meta/Packaging
Priority
Blocking
Priority
High
Priority
Low
Security
Status
Confirmed
Status
Duplicate
Status
Invalid
Status
Needs Investigation
Wont fix
old/ci/cd
old/rust
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: continuwuation/continuwuity#876
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nex/user-suspension"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR implements user suspension, part of the 1.13 matrix spec.
Specifically, the set of specific forbidden actions are implemented, rather than explicitly permitted. Room creation is additionally forbidden, despite it being missing from the spec defs, because there's no legitimate reason to create rooms you cannot send nor invite to.
Added some additional suspension checks:
Also, suspended users can no-longer send public read receipts, or typing. I'm pretty sure this covers the basis for all "write" endpoints now.
@ -143,6 +145,16 @@ impl Service {
Ok(())
}
/// Suspend account, placing it in a read-only state
Might want to use an actual struct here. In case we want to add things like time to suspensions, oh being able to send in specific rooms to communicate with admins
if this is a suggestion rather than a reasoning for using a struct, I think that's best suited for another PR
Comments can be fixed when a 'list suspended users' command or something is added
@ -37,2 +38,4 @@
})
}
/// Get the sender as a string, or service user ID if not available
Oh no this comment is wrong, oh well, never mind
@ -227,0 +238,4 @@
if self.services.users.is_admin(&user_id).await {
return Err!("Admin users cannot be suspended.");
}
// TODO: Record the actual user that sent the suspension where possible
And this one