mirror of
https://github.com/1f349/lavender.git
synced 2024-12-22 15:44:07 +00:00
18 lines
245 B
Go
18 lines
245 B
Go
|
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
|
||
|
}
|