MCPcopy
hub / github.com/tinyauthapp/tinyauth / IsUserAllowed

Method IsUserAllowed

internal/service/auth_service.go:462–477  ·  view source on GitHub ↗
(c *gin.Context, context config.UserContext, acls config.App)

Source from the content-addressed store, hash-verified

460}
461
462func (auth *AuthService) IsUserAllowed(c *gin.Context, context config.UserContext, acls config.App) bool {
463 if context.OAuth {
464 tlog.App.Debug().Msg("Checking OAuth whitelist")
465 return utils.CheckFilter(acls.OAuth.Whitelist, context.Email)
466 }
467
468 if acls.Users.Block != "" {
469 tlog.App.Debug().Msg("Checking blocked users")
470 if utils.CheckFilter(acls.Users.Block, context.Username) {
471 return false
472 }
473 }
474
475 tlog.App.Debug().Msg("Checking users")
476 return utils.CheckFilter(acls.Users.Allow, context.Username)
477}
478
479func (auth *AuthService) IsInOAuthGroup(c *gin.Context, context config.UserContext, requiredGroups string) bool {
480 if requiredGroups == "" {

Callers 1

proxyHandlerMethod · 0.80

Calls 1

CheckFilterFunction · 0.92

Tested by

no test coverage detected