Skip to content

Commit

Permalink
Require approval to get building access (#2)
Browse files Browse the repository at this point in the history
A keycloak admin must now approve an account before it is granted
building access. This allows us to meet them, make sure they're a real
person, etc. before enabling their fob.

Users are still able to immediately set a fob when creating an account,
it just won't be activated yet.
  • Loading branch information
jveski authored Dec 1, 2023
1 parent 194486a commit 62ee061
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions keycloak/keycloak.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ func newAccessUser(kcuser *gocloak.User) *AccessUser {
if fobID == 0 {
return nil
}
if firstElOrZeroVal(attr["buildingAccessApprover"]) == "" {
return nil // no access for accounts that haven't explicitly been granted building access
}

return &AccessUser{
UUID: *kcuser.ID,
Expand Down

0 comments on commit 62ee061

Please sign in to comment.