import "k8s.io/apimachinery/pkg/apis/meta/v1" func IsUserClusterAdmin(user *v1.User) bool { if user == nil { return false } if len(user.GetExtra()) == 0 { return false } _, ok := user.GetExtra()["system:masters"] return ok }In the above code example, the IsUserClusterAdmin function takes a User object as input and checks whether the user has cluster-admin role permissions. If the user has the required role, the function returns true, else it returns false. Package/Library: The package/library that contains the User IsClusterAdmin function is the Kubernetes API. Specifically, it is part of the `k8s.io/apimachinery/pkg/apis/meta/v1` package in the Kubernetes API. This package provides utilities for working with Kubernetes objects such as pods, services, and users.