12 lines
242 B
Go
12 lines
242 B
Go
package permissions
|
|
|
|
import "strings"
|
|
|
|
func MatchScope(pattern, scope string) bool {
|
|
if strings.HasSuffix(pattern, "/*") {
|
|
prefix := strings.TrimSuffix(pattern, "/*")
|
|
return strings.HasPrefix(scope, prefix)
|
|
}
|
|
return pattern == scope
|
|
}
|