code: func (impl *repoImpl) DeleteRef(c context.Context, r *api.DeleteRefRequest) (resp *empty.Empty, err error) {
  	defer func() { err = grpcutil.GRPCifyAndLogErr(c, err) }()
  
  	// Validate the request.
  	if err := common.ValidatePackageRef(r.Name); err != nil {
  		return nil, status.Errorf(codes.InvalidArgument, "bad 'name' - %s", err)
  	}
  	if err := common.ValidatePackageName(r.Package); err != nil {
  		return nil, status.Errorf(codes.InvalidArgument, "bad 'package' - %s", err)
  	}
  
  	// Check ACLs.
  	if _, err := impl.checkRole(c, r.Package, api.Role_WRITER); err != nil {
  		return nil, err
  	}
  
  	// Verify the package actually exists, per DeleteRef contract.
  	if err := model.CheckPackageExists(c, r.Package); err != nil {
  		return nil, err
  	}
  
  	// Actually delete the ref.
  	if err := model.DeleteRef(c, r.Package, r.Name); err != nil {
  		return nil, err
  	}
  	return &empty.Empty{}, nil
  }
docs: // DeleteRef implements the corresponding RPC method, see the proto doc.