aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/stream.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-04 20:41:59 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-04 20:41:59 +0200
commit347274afb36e926b328e799ca8004fc874ffe4cb (patch)
tree8c7ec38938e3673ce5752bffa9442daa9f589f3d /server/src/routes/stream.rs
parent4095a8804c17c3ec12706f00d3694f564afc0b95 (diff)
downloadjellything-347274afb36e926b328e799ca8004fc874ffe4cb.tar
jellything-347274afb36e926b328e799ca8004fc874ffe4cb.tar.bz2
jellything-347274afb36e926b328e799ca8004fc874ffe4cb.tar.zst
more permission stuff
Diffstat (limited to 'server/src/routes/stream.rs')
-rw-r--r--server/src/routes/stream.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/src/routes/stream.rs b/server/src/routes/stream.rs
index 21575b6..b1248ba 100644
--- a/server/src/routes/stream.rs
+++ b/server/src/routes/stream.rs
@@ -6,7 +6,7 @@
use super::ui::{account::session::Session, error::MyError};
use crate::{database::Database, federation::Federation};
use anyhow::{anyhow, Result};
-use jellybase::CONF;
+use jellybase::{permission::NodePermissionExt, CONF};
use jellycommon::{stream::StreamSpec, MediaSource};
use log::{info, warn};
use rocket::{
@@ -36,7 +36,7 @@ pub async fn r_stream_head(
#[get("/n/<id>/stream?<spec..>")]
pub async fn r_stream(
- _sess: Session,
+ session: Session,
federation: &State<Federation>,
db: &State<Database>,
id: &str,
@@ -46,6 +46,7 @@ pub async fn r_stream(
let node = db
.node
.get(&id.to_string())?
+ .only_if_permitted(&session.user.permissions)
.ok_or(anyhow!("node does not exist"))?;
let source = node
.private