我想授予在公司工作的所有“人员”参与者的读取权限,其中公司的类型是“边界”。公司类型是一个枚举。
访问控制列表:
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
}
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 transaction {
description: "Allow participants full access to transactions"
participant: "org.acme.shipping.participants.Person"
operation: ALL
resource: "org.acme.shipping.transactions.**"
action: ALLOW
}
rule containers {
description: "Allow participants access to containers owned by their company"
participant(p): "org.acme.shipping.participants.Person"
operation: ALL
resource(c): "org.acme.shipping.assets.**"
condition: (c.owner.getIdentifier() == p.company.getIdentifier())
action: ALLOW
}
rule border {
description: "Allow Border access to containers"
participant(p): "org.acme.shipping.participants.Person"
operation: READ
resource: "org.acme.shipping.assets.**"
condition: (p.company.type == "BORDER")
action: ALLOW
}
参与者模型文件:
namespace org.acme.shipping.participants
participant Company identified by cid {
o String cid
o String name
o CompanyType type
}
enum CompanyType {
o BORDER
o COURIER
o SHIPPER
}
participant Person identified by id {
o String id
o String name
--> Company company
}
但是,Person 仍然看不到任何资产。
有什么建议可以解决吗?