From b9cb1dba9d4c02aaba3231cef51ca383f211e658 Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Mon, 25 Nov 2024 10:43:29 +0100 Subject: [PATCH] Changed logic to decide whether an account is Primary --- user/rest.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/user/rest.go b/user/rest.go index 98a0f7e..7d84d9d 100644 --- a/user/rest.go +++ b/user/rest.go @@ -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