1
0
Fork 0
forked from alemi/upub

feat: allow checking if identity is someone

This commit is contained in:
əlemi 2024-05-01 17:47:21 +02:00
parent 71c3c54859
commit 75d03195d9
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -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)
}