diff --git a/src/server/auth.rs b/src/server/auth.rs index 8c124fb..95d57b7 100644 --- a/src/server/auth.rs +++ b/src/server/auth.rs @@ -38,6 +38,14 @@ impl Identity { } } + pub fn is(&self, id: &str) -> bool { + match self { + Identity::Anonymous => false, + Identity::Remote(_) => false, // TODO per-actor server auth should check this + Identity::Local(uid) => uid.as_str() == id + } + } + pub fn is_anon(&self) -> bool { matches!(self, Self::Anonymous) }