/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2025 metamuffin */ use crate::session::Session; use anyhow::{Result, anyhow}; impl Session { pub fn assert_admin(&self) -> Result<()> { if self.user.admin { Ok(()) } else { Err(anyhow!("Permission denied.")) } } }