// SPDX-FileCopyrightText: Politik im Blick developers
// SPDX-FileCopyrightText: Wolfgang Silbermayr <wolfgang@silbermayr.at>
//
// SPDX-License-Identifier: AGPL-3.0-or-later OR EUPL-1.2

#[derive(Debug, Clone, PartialEq, Eq, Copy)]
pub enum Admission {
    Allow,
    Deny,
}

impl Admission {
    pub const fn is_allowed(&self) -> bool {
        matches!(self, Self::Allow)
    }

    pub const fn is_denied(&self) -> bool {
        matches!(self, Self::Deny)
    }
}

impl From<bool> for Admission {
    fn from(value: bool) -> Self {
        match value {
            true => Self::Allow,
            false => Self::Deny,
        }
    }
}
