Skip to content

Commit b9cb1db

Browse files
committed
Changed logic to decide whether an account is Primary
1 parent 9969421 commit b9cb1db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

user/rest.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,10 @@ func (i *Identity) UserType() userpb.UserType {
185185
case "Secondary":
186186
return userpb.UserType_USER_TYPE_SECONDARY
187187
case "Person":
188-
if i.Source == "cern" && i.ActiveUser {
189-
// this is a CERN account; incidentally, also i.UID > 0 qualifies for that
188+
if i.Source == "cern" && i.UID > 0 {
189+
// this is a CERN account; here we should check if i.ActiveUser = true,
190+
// but users that have just left the Organization have ActiveUser = false,
191+
// whereas users with UID = 0 are definitely non-primary.
190192
return userpb.UserType_USER_TYPE_PRIMARY
191193
}
192194
return userpb.UserType_USER_TYPE_LIGHTWEIGHT // external user

0 commit comments

Comments
 (0)