В моем файле query.qry
определен следующий запрос:
query selectItemsByOwner {
description: "Select all items based on their owner uid"
statement:
SELECT org.example.auctchain.Item
WHERE (owner.uid == _$uid)
}
Мой файл разрешений ACL имеет следующие правила:
rule Auctioneer {
description: "Allow the auctioneer full access"
participant: "org.example.auctchain.Auctioneer"
operation: ALL
resource: "org.example.auctchain.*"
action: ALLOW
}
rule Member {
description: "Allow the member read access"
participant: "org.example.auctchain.Member"
operation: READ
resource: "org.example.auctchain.*"
action: ALLOW
}
rule VehicleOwner {
description: "Allow the owner of a vehicle total access"
participant(m): "org.example.auctchain.Member"
operation: ALL
resource(v): "org.example.auctchain.Item"
condition: (v.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule VehicleListingOwner {
description: "Allow the owner of a vehicle total access to their
vehicle listing"
participant(m): "org.example.auctchain.Member"
operation: ALL
resource(v): "org.example.auctchain.ItemListing"
condition: (v.vehicle.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule SystemACL {
description: "System ACL to permit all access"
participant: "org.hyperledger.composer.system.Participant"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}
rule NetworkAdminUser {
description: "Grant business network administrators full access to
user resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "**"
action: ALLOW
}
rule NetworkAdminSystem {
description: "Grant business network administrators full access to
system resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}
ИМой файл CTO определяет задействованных Активов и Участников следующим образом:
asset Item identified by itemId {
o String itemId
o String name
o ItemType type
--> Member owner
}
abstract participant User identified by uid {
o String uid
o String email
o String firstName
o String lastName
o String phoneNumber
}
participant Member extends User {
o Double balance
}
Я обновил свою версию package.json
и создал файл BNA, затем установил его в моей сети и выполнил обновление, все прошло нормально.Проблема возникает, когда я выполняю этот запрос из моего приложения Angular или из Composer REST API Explorer, оба возвращают пустой массив.У кого-нибудь была эта проблема?Кажется, я не могу найти решение, и это действительно беспокоит меня, так как мне действительно нужно выполнять запросы в моем приложении.