Organize device inventory by customer and restrict token access to its audience
This commit is contained in:
@@ -210,6 +210,12 @@ impl LocalAuth {
|
||||
workers: Arc::new(Semaphore::new(1)),
|
||||
})
|
||||
}
|
||||
pub fn home(&self, principal: &str) -> Option<Uuid> {
|
||||
self.users
|
||||
.iter()
|
||||
.find(|user| !user.disabled && user.principal == principal)
|
||||
.map(|user| user.tenant)
|
||||
}
|
||||
pub fn enabled(&self, principal: &str, tenant: Uuid) -> bool {
|
||||
self.users
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user