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: accesscontrol.go
    path of file: ./repos/grafana/pkg/services/libraryelements
    
    the code of the file until where you have to start completion: package libraryelements

import (
	"context"
	"errors"
	"strings"

	"github.com/grafana/grafana/pkg/infra/appcontext"
	ac "github.com/grafana/grafana/pkg/services/accesscontrol"
	"github.com/grafana/grafana/pkg/services/dashboards"
	"github.com/grafana/grafana/pkg/services/folder"
	"github.com/grafana/grafana/pkg/services/libraryelements/model"
)

const (
	ScopeLibraryPanelsRoot   = "library.panels"
	ScopeLibraryPanelsPrefix = "library.panels:uid:"

	ActionLibraryPanelsCreate = "library.panels:create"
	ActionLibraryPanelsRead   = "library.panels:read"
	ActionLibraryPanelsWrite  = "library.panels:write"
	ActionLibraryPanelsDelete = "library.panels:delete"
)

var (
	ScopeLibraryPanelsP
    
func LibraryPanelUIDScopeResolver(l *LibraryElementService, folderSvc folder.Service) (string, ac.ScopeAttributeResolver) {
	prefix := ScopeLibraryPanelsProvider.GetResourceScopeUID("")
	return prefix, ac.ScopeAttributeResolverFunc(func(ctx context.Context, orgID int64, scope string) ([]string, error) {
		if !strings.HasPrefix(scope, prefix) {
			return nil, ac.ErrInvalidScope
		}

		uid, err := ac.ParseScopeUID(scope)
		if err != nil {
			return nil, err
		}

		user, err := appcontext.User(ctx)
		if err != nil {
			return nil, err
		}

		libElDTO, err := l.getLibraryElementByUid(ctx, user, model.GetLibraryElementCommand{
			UID:        uid,
			FolderName: dashboards.RootFolderName,
		})
		if err != nil {
			return nil, err
		}

		inheritedScopes, err := dashboards.GetInheritedScopes(ctx, orgID, libElDTO.FolderUID, folderSvc)
		if err != nil {
			return nil, err
		}
		return append(inheritedScopes, dashboards.ScopeFoldersProvider.GetResourceScopeUID(libElDTO.FolderUID), ScopeLibraryPanelsProvider.GetResourceScopeUID(uid)), nil
	})
}