Files
bssapp/svc/internal/authz/mssql_helpers.go
2026-02-11 17:46:22 +03:00

25 lines
419 B
Go

package authz
import (
"fmt"
"strings"
)
func BuildINClause(column string, codes []string) string {
if len(codes) == 0 {
return "1=0"
}
var quoted []string
for _, c := range codes {
c = strings.TrimSpace(strings.ToUpper(c))
if c == "" {
continue
}
quoted = append(quoted, "'"+c+"'")
}
if len(quoted) == 0 {
return "1=0"
}
return fmt.Sprintf("%s IN (%s)", column, strings.Join(quoted, ","))
}