Skip to content

Commit

Permalink
🐛 Add missed permission check for file:download in get_media_file
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronleopold committed Apr 14, 2024
1 parent e03442b commit 1bdc664
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/server/src/routers/api/v1/media.rs
Expand Up @@ -787,7 +787,7 @@ async fn get_media_file(
) -> APIResult<NamedFile> {
let db = &ctx.db;

let user = get_session_user(&session)?;
let user = enforce_session_permissions(&session, &[UserPermission::DownloadFile])?;
let age_restrictions = user
.age_restriction
.as_ref()
Expand Down Expand Up @@ -836,6 +836,7 @@ async fn convert_media(
) -> Result<(), APIError> {
let db = &ctx.db;

// TODO: if keeping, enforce permission
let user = get_session_user(&session)?;
let age_restrictions = user
.age_restriction
Expand Down

0 comments on commit 1bdc664

Please sign in to comment.