add: channels/messages scopes and api endpoints

This commit is contained in:
trisua 2025-06-13 22:07:36 -04:00
parent 8f16068a34
commit b29760d7ec
10 changed files with 195 additions and 63 deletions

View file

@ -4,7 +4,7 @@ use axum_extra::extract::CookieJar;
use pathbufd::PathBufD;
use crate::{get_user_from_token, State};
use super::auth::images::read_image;
use tetratto_core::model::{ApiReturn, Error};
use tetratto_core::model::{oauth, ApiReturn, Error};
pub async fn get_request(
Path(id): Path<usize>,
@ -38,7 +38,7 @@ pub async fn delete_request(
Path(id): Path<usize>,
) -> impl IntoResponse {
let data = &(data.read().await).0;
let user = match get_user_from_token!(jar, data) {
let user = match get_user_from_token!(jar, data, oauth::AppScope::UserManageUploads) {
Some(ua) => ua,
None => return Json(Error::NotAllowed.into()),
};