code: func (impl *repoImpl) AttachTags(c context.Context, r *api.AttachTagsRequest) (resp *empty.Empty, err error) {
  	defer func() { err = grpcutil.GRPCifyAndLogErr(c, err) }()
  
  	// Validate the request.
  	if err := validateMultiTagReq(r.Package, r.Instance, r.Tags); err != nil {
  		return nil, err
  	}
  
  	// Check ACLs.
  	if _, err := impl.checkRole(c, r.Package, api.Role_WRITER); err != nil {
  		return nil, err
  	}
  
  	// Actually attach the tags. This will also transactionally check the instance
  	// exists and it has passed the processing successfully.
  	inst := &model.Instance{
  		InstanceID: common.ObjectRefToInstanceID(r.Instance),
  		Package:    model.PackageKey(c, r.Package),
  	}
  	if err := model.AttachTags(c, inst, r.Tags); err != nil {
  		return nil, err
  	}
  	return &empty.Empty{}, nil
  }
docs: // AttachTags implements the corresponding RPC method, see the proto doc.