use std::collections::HashMap; use db::permissions::PermissionRaw; use crate::prelude::*; #[derive(Deserialize, Debug)] pub struct Params { folder_id: Uuid, } pub async fn get( State(pool): State, Query(params): Query, claims: Claims, ) -> GeneralResult>> { db::folder::get_permissions(params.folder_id, claims.user_id, &pool) .await .can_read_guard()?; db::permissions::get_all_for_folder(params.folder_id, &pool) .await .handle_internal("Error getting permissions") .map(Json) }