mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-06-29 23:24:35 +02:00
feat: Prevent suspended users uploading media
This commit is contained in:
parent
90180916eb
commit
8e06571e7c
1 changed files with 3 additions and 0 deletions
|
@ -52,6 +52,9 @@ pub(crate) async fn create_content_route(
|
|||
body: Ruma<create_content::v3::Request>,
|
||||
) -> Result<create_content::v3::Response> {
|
||||
let user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
if services.users.is_suspended(user).await? {
|
||||
return Err!(Request(UserSuspended("You cannot perform this action while suspended.")));
|
||||
}
|
||||
|
||||
let filename = body.filename.as_deref();
|
||||
let content_type = body.content_type.as_deref();
|
||||
|
|
Loading…
Add table
Reference in a new issue