feat: implement channel invites, perms, group create, members fetch

chore: when you accidentally run fmt
This commit is contained in:
Paul Makles
2022-02-04 21:50:30 +00:00
parent b58755dbeb
commit 88f811761b
59 changed files with 536 additions and 195 deletions

View File

@@ -1,16 +1,16 @@
//! Fetch another user
//!
//!
//! Will fail if the authenticated user does not
//! have permission to access the other user.
use revolt_quark::{Ref, Result, Error, models::User, perms, Database};
use revolt_quark::{models::User, perms, Database, Error, Ref, Result};
use rocket::{serde::json::Json, State};
#[get("/<target>")]
pub async fn req(db: &State<Database>, user: User, target: Ref) -> Result<Json<User>> {
let target = target.as_user(db).await?;
let permissions = perms(&user).user(&target).calc_user(db).await;
if permissions.get_access() {
Ok(Json(target.with_perspective(&user, &permissions)))