add: ability to join/leave/be banned from communities

This commit is contained in:
trisua 2025-03-31 15:39:49 -04:00
parent f3c2157dfc
commit 619184d02e
28 changed files with 618 additions and 197 deletions

View file

@ -120,13 +120,10 @@ pub async fn upload_avatar_request(
Err(e) => return Json(e.into()),
};
if auth_user.id != community.owner {
if !auth_user
if auth_user.id != community.owner && !auth_user
.permissions
.check(FinePermission::MANAGE_COMMUNITIES)
{
return Json(Error::NotAllowed.into());
}
.check(FinePermission::MANAGE_COMMUNITIES) {
return Json(Error::NotAllowed.into());
}
let path = pathd!(
@ -176,13 +173,10 @@ pub async fn upload_banner_request(
Err(e) => return Json(e.into()),
};
if auth_user.id != community.owner {
if !auth_user
if auth_user.id != community.owner && !auth_user
.permissions
.check(FinePermission::MANAGE_COMMUNITIES)
{
return Json(Error::NotAllowed.into());
}
.check(FinePermission::MANAGE_COMMUNITIES) {
return Json(Error::NotAllowed.into());
}
let path = pathd!(