code: func addOrgs(stub shim.ChaincodeStubInterface) pb.Response {
  	_, parameters := stub.GetFunctionAndParameters()
  	if len(parameters) < 2 {
  		return shim.Error("No orgs to add specified")
  	}
  
  	// get the endorsement policy for the key
  	var epBytes []byte
  	var err error
  	if parameters[0] == "pub" {
  		epBytes, err = stub.GetStateValidationParameter("pub")
  	} else if parameters[0] == "priv" {
  		epBytes, err = stub.GetPrivateDataValidationParameter("col", "priv")
  	} else {
  		return shim.Error("Unknown key specified")
  	}
  	if err != nil {
  		return shim.Error(err.Error())
  	}
  	ep, err := statebased.NewStateEP(epBytes)
  	if err != nil {
  		return shim.Error(err.Error())
  	}
  
  	// add organizations to endorsement policy
  	err = ep.AddOrgs(statebased.RoleTypePeer, parameters[1:]...)
  	if err != nil {
  		return shim.Error(err.Error())
  	}
  	epBytes, err = ep.Policy()
  	if err != nil {
  		return shim.Error(err.Error())
  	}
  
  	// set the modified endorsement policy for the key
  	if parameters[0] == "pub" {
  		err = stub.SetStateValidationParameter("pub", epBytes)
  	} else if parameters[0] == "priv" {
  		err = stub.SetPrivateDataValidationParameter("col", "priv", epBytes)
  	}
  	if err != nil {
  		return shim.Error(err.Error())
  	}
  
  	return shim.Success([]byte{})
  }
docs: // addOrgs adds the list of MSP IDs from the invocation parameters
  // to the state's endorsement policy