Skip to content

Commit

Permalink
add check for regular user
Browse files Browse the repository at this point in the history
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
  • Loading branch information
bcmmbaga committed Nov 7, 2024
1 parent 78044c2 commit 1a5f3c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions management/server/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1a5f3c6

Please sign in to comment.