Skip to content

Commit

Permalink
Fix: missing check for draft status on album editing
Browse files Browse the repository at this point in the history
TobiasDeBruijn committed Feb 22, 2024
1 parent b8fbc69 commit 78ec089
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/chroma/src/routes/v1/album/update.rs
Original file line number Diff line number Diff line change
@@ -35,6 +35,10 @@ pub async fn update(
.await?
.ok_or(Error::NotFound)?;

if !album.is_draft && !auth.is_admin {
return Err(Error::Forbidden);
}

if let Some(name) = &payload.name {
if name.len() > Album::MAX_NAME_LENGTH {
return Err(Error::BadRequest(format!(

0 comments on commit 78ec089

Please sign in to comment.