feat: allow checking if identity is someone
This commit is contained in:
parent
71c3c54859
commit
75d03195d9
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue