lavender/server/roles.go

18 lines
245 B
Go
Raw Normal View History

2024-02-07 01:18:17 +00:00
package server
import (
"bufio"
"strings"
)
func HasRole(roles, test string) bool {
sc := bufio.NewScanner(strings.NewReader(roles))
sc.Split(bufio.ScanWords)
for sc.Scan() {
if sc.Text() == test {
return true
}
}
return false
}