Translate the LDAP DN into user IDs

This commit is contained in:
Valentin Tolmer
2021-05-13 19:31:37 +02:00
parent 7e76d3aae2
commit b49a03fd87
3 changed files with 127 additions and 9 deletions

View File

@@ -160,6 +160,11 @@ impl BackendHandler for SqlBackendHandler {
}
async fn get_user_groups(&self, user: String) -> Result<HashSet<String>> {
if user == self.config.ldap_user_dn {
let mut groups = HashSet::new();
groups.insert("lldap_admin".to_string());
return Ok(groups);
}
let query: String = Query::select()
.column(Groups::DisplayName)
.from(Groups::Table)