(c *gin.Context, context config.UserContext, requiredGroups string)
| 500 | } |
| 501 | |
| 502 | func (auth *AuthService) IsInLdapGroup(c *gin.Context, context config.UserContext, requiredGroups string) bool { |
| 503 | if requiredGroups == "" { |
| 504 | return true |
| 505 | } |
| 506 | |
| 507 | for userGroup := range strings.SplitSeq(context.LdapGroups, ",") { |
| 508 | if utils.CheckFilter(requiredGroups, strings.TrimSpace(userGroup)) { |
| 509 | tlog.App.Trace().Str("group", userGroup).Str("required", requiredGroups).Msg("User group matched") |
| 510 | return true |
| 511 | } |
| 512 | } |
| 513 | |
| 514 | tlog.App.Debug().Msg("No groups matched") |
| 515 | return false |
| 516 | } |
| 517 | |
| 518 | func (auth *AuthService) IsAuthEnabled(uri string, path config.AppPath) (bool, error) { |
| 519 | // Check for block list |
no test coverage detected