Skip to content

Commit

Permalink
Changed logic to decide whether an account is Primary
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern committed Nov 25, 2024
1 parent 9969421 commit b9cb1db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions user/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ func (i *Identity) UserType() userpb.UserType {
case "Secondary":
return userpb.UserType_USER_TYPE_SECONDARY
case "Person":
if i.Source == "cern" && i.ActiveUser {
// this is a CERN account; incidentally, also i.UID > 0 qualifies for that
if i.Source == "cern" && i.UID > 0 {
// this is a CERN account; here we should check if i.ActiveUser = true,
// but users that have just left the Organization have ActiveUser = false,
// whereas users with UID = 0 are definitely non-primary.
return userpb.UserType_USER_TYPE_PRIMARY
}
return userpb.UserType_USER_TYPE_LIGHTWEIGHT // external user
Expand Down

0 comments on commit b9cb1db

Please sign in to comment.