Blockchain 从交易记录更新Hyperledger ACL

Blockchain 从交易记录更新Hyperledger ACL,blockchain,hyperledger,hyperledger-composer,Blockchain,Hyperledger,Hyperledger Composer,我在网络上有用户和买家参与者。通常,买家无法读取用户的数据,但我希望进行GrantAccess和RevokeAccess交易,以便用户可以选择从买家处授予和撤销读取权限 我还没有找到任何关于如何做到这一点的信息,非常感谢您的帮助。您将运行一个“tx\u GrantAccess”交易,该交易首先更新特定买家的记录,例如id buyer123-一个使用名为access的字段建模的参与者,该字段通过该交易设置为true 我可以在目标买家记录资源上使用条件匹配作为布尔值,如果买家(比如正在访问业务网络的

我在网络上有用户和买家参与者。通常,买家无法读取用户的数据,但我希望进行GrantAccess和RevokeAccess交易,以便用户可以选择从买家处授予和撤销读取权限


我还没有找到任何关于如何做到这一点的信息,非常感谢您的帮助。

您将运行一个“tx\u GrantAccess”交易,该交易首先更新特定买家的记录,例如id buyer123-一个使用名为access的字段建模的参与者,该字段通过该交易设置为true

我可以在目标买家记录资源上使用条件匹配作为布尔值,如果买家(比如正在访问业务网络的buyer123 ie has access=true)可以读取用户记录

用户访问事务类所需的事务规则

rule rule_1 {
description: "grant access to User, for the 2 x Transactions themselves"
participant: "org.acme.example.User"
operation: CREATE
resource: "org.acme.example.tx_*"
action: ALLOW
} 
用户访问规则:

rule rule_2 {
description: "if granted access, allow READ of User by buyer"
participant(m): "org.acme.example.Buyer"
operation: READ
resource(v): "org.acme.example.User"
condition: (m.access)
action: ALLOW
}
买方有字段的地方,例如

participant Buyer identified by id {
o String id
o Boolean access default=false
}
您的交易tx_GrantAccess有一个功能,可以将特定买家记录上的access设置为true,tx_RevokeAccess将其设置为false等