From 1a5f3c653c4b78a5c52bca9bba74c966fbd7495c Mon Sep 17 00:00:00 2001 From: bcmmbaga Date: Fri, 8 Nov 2024 00:37:47 +0300 Subject: [PATCH] add check for regular user Signed-off-by: bcmmbaga --- management/server/user.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/management/server/user.go b/management/server/user.go index 9fdd3a6eeea..1368b76b121 100644 --- a/management/server/user.go +++ b/management/server/user.go @@ -103,6 +103,11 @@ func (u *User) IsAdminOrServiceUser() bool { return u.HasAdminPower() || u.IsServiceUser } +// IsRegularUser checks if the user is a regular user. +func (u *User) IsRegularUser() bool { + return !u.HasAdminPower() && !u.IsServiceUser +} + // ToUserInfo converts a User object to a UserInfo object. func (u *User) ToUserInfo(userData *idp.UserData, settings *Settings) (*UserInfo, error) { autoGroups := u.AutoGroups