You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: checker.go
    path of file: ./repos/grafana/pkg/services/accesscontrol
    
    the code of the file until where you have to start completion: package accesscontrol

import (
	"github.com/grafana/grafana/pkg/services/user"
)

func Checker(user *user.SignedInUser, action string) func(scopes ...string) bool {
	if user.Permissions == nil || user.Permissions[user.OrgID] == nil {
		return func(scopes ...string) bool { return false }
	}

	userScopes, ok := user.Permissions[user.OrgID][action]
	if !ok {
		return func(scopes ...string) bool { return false }
	}

	lookup := make(map[string]bool, len(userScopes))
	for i := range userScopes {
		lookup[userScopes[i]] = true
	}

	var checkedWildcards bool
	var hasWildcard bool

	return func(scopes ...string) bool {
		if !checkedWildcards {
			wildcards := wildcardsFromScopes(scopes...)
			for _, w := range wildcar
    
func Checker(user *user.SignedInUser, action string) func(scopes ...string) bool {
	if user.Permissions == nil || user.Permissions[user.OrgID] == nil {
		return func(scopes ...string) bool { return false }
	}

	userScopes, ok := user.Permissions[user.OrgID][action]
	if !ok {
		return func(scopes ...string) bool { return false }
	}

	lookup := make(map[string]bool, len(userScopes))
	for i := range userScopes {
		lookup[userScopes[i]] = true
	}

	var checkedWildcards bool
	var hasWildcard bool

	return func(scopes ...string) bool {
		if !checkedWildcards {
			wildcards := wildcardsFromScopes(scopes...)
			for _, w := range wildcards {
				if _, ok := lookup[w]; ok {
					hasWildcard = true
					break
				}
			}
			checkedWildcards = true
		}

		if hasWildcard {
			return true
		}

		for _, s := range scopes {
			if lookup[s] {
				return true
			}
		}
		return false
	}
}