code: func RoleEscalationAuthorized(ctx context.Context, a authorizer.Authorizer) bool {
  	if a == nil {
  		return false
  	}
  
  	user, ok := genericapirequest.UserFrom(ctx)
  	if !ok {
  		return false
  	}
  
  	requestInfo, ok := genericapirequest.RequestInfoFrom(ctx)
  	if !ok {
  		return false
  	}
  
  	if !requestInfo.IsResourceRequest {
  		return false
  	}
  
  	requestResource := schema.GroupResource{Group: requestInfo.APIGroup, Resource: requestInfo.Resource}
  	if !roleResources[requestResource] {
  		return false
  	}
  
  	attrs := authorizer.AttributesRecord{
  		User:            user,
  		Verb:            "escalate",
  		APIGroup:        requestInfo.APIGroup,
  		Resource:        requestInfo.Resource,
  		Name:            requestInfo.Name,
  		Namespace:       requestInfo.Namespace,
  		ResourceRequest: true,
  	}
  
  	decision, _, err := a.Authorize(attrs)
  	if err != nil {
  		utilruntime.HandleError(fmt.Errorf(
  			"error authorizing user %#v to escalate %#v named %q in namespace %q: %v",
  			user, requestResource, requestInfo.Name, requestInfo.Namespace, err,
  		))
  	}
  	return decision == authorizer.DecisionAllow
  }
docs: // RoleEscalationAuthorized checks if the user associated with the context is explicitly authorized to escalate the role resource associated with the context