I am getting bellow error while playing around Hyperledger Composer.
{
"$class": "org.property.registration.purchaseProperty",
"propertyListing":
"resource:org.property.registration.PropertyListing#PL001"
}
Error: attempt to get property owner on an InvalidRelationship is not allowed. InvalidRelationship created due to Object with ID '1003' in collection with ID 'Asset:org.property.registration.Property' does not exist; [cause=Participant 'org.property.registration.User#0001' does not have 'READ' access to resource 'org.property.registration.Property#1003']
I am trying to access Asset property which is a part of another asset propertyListing.
asset Property identified by PID {
o String PID
o Integer marketPrice
o DateTime regDate
o String propertyType
o String location
o String status default= "Registered"
--> User owner
}
asset PropertyListing identified by PLID {
o String PLID
--> Property property
}
I am trying to access PropertyListing asset and change status of property asset inside it. (I want to purchase the property from the propertyListing posted by some other user)
const registry = await getAssetRegistry(tx.propertyListing.property.getFullyQualifiedType());
await registry.update(tx.propertyListing.property);
// Remove the property from propertyListing()
const registry2 = await getAssetRegistry(tx.propertyListing.getFullyQualifiedType());
await registry2.remove(tx.propertyListing);
I hope and as per the error message it seems like some permission issue which is blocking me to purchase the property post by other user.
// User can see all properties listed for sale
rule UserAccessAllSaleProperties {
description: "Allow Users to access all properties listed for sale"
participant: "org.property.registration.User"
operation: ALL
resource: "org.property.registration.PropertyListing"
action: ALLOW
}
Here i want to access the property which is part of PropertyListing. I am trying to find what short of ACL i can use. Still trying.
Guys your suggestions are welcome!!!