Skip to main content

assert_can_delete_logo

Function assert_can_delete_logo 

Source
pub async fn assert_can_delete_logo(
    db: &SqlitePool,
    current_user: Uuid,
    logo_id: Uuid,
) -> Result<LogoRow, Error>
Expand description

Permission gate for deleting a logo. Personal: must be the owner. Group: must be an owner of the group.

The FK saved_render_logos.logo_id is ON DELETE RESTRICT, so a logo referenced by any render fails the DELETE with a SQLite constraint violation; the route handler maps that to a human-readable error.

ยงErrors

Returns Error::Forbidden if the user lacks delete permission; Error::NotFound if the row does not exist.