Skip to main content

ephemeris_forge/access/
lockout.rs

1use std::fmt;
2
3use super::{TeamName, UserName};
4
5/// A grant that carries the caller's own access and that a plan would remove.
6#[derive(Clone, Debug, Eq, PartialEq)]
7pub enum Lockout {
8    /// A team the caller belongs to.
9    Team(TeamName),
10    /// The caller's own collaborator grant.
11    Collaborator(UserName),
12}
13
14impl fmt::Display for Lockout {
15    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16        match self {
17            Self::Team(team) => write!(f, "team {team}"),
18            Self::Collaborator(user) => write!(f, "collaborator {user}"),
19        }
20    }
21}