(c *gin.Context, context config.UserContext, requiredGroups string)
| 477 | } |
| 478 | |
| 479 | func (auth *AuthService) IsInOAuthGroup(c *gin.Context, context config.UserContext, requiredGroups string) bool { |
| 480 | if requiredGroups == "" { |
| 481 | return true |
| 482 | } |
| 483 | |
| 484 | for id := range config.OverrideProviders { |
| 485 | if context.Provider == id { |
| 486 | tlog.App.Info().Str("provider", id).Msg("OAuth groups not supported for this provider") |
| 487 | return true |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | for userGroup := range strings.SplitSeq(context.OAuthGroups, ",") { |
| 492 | if utils.CheckFilter(requiredGroups, strings.TrimSpace(userGroup)) { |
| 493 | tlog.App.Trace().Str("group", userGroup).Str("required", requiredGroups).Msg("User group matched") |
| 494 | return true |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | tlog.App.Debug().Msg("No groups matched") |
| 499 | return false |
| 500 | } |
| 501 | |
| 502 | func (auth *AuthService) IsInLdapGroup(c *gin.Context, context config.UserContext, requiredGroups string) bool { |
| 503 | if requiredGroups == "" { |
no test coverage detected