我只想让Seller看到他的账户:Seller在他的Account上有READ访问权限。但是我下面的规则不起作用。我该怎么做呢?
//Sellers to have read access to Account asset
rule SellerReadAccessAccountsRecord {
description: "Allow seller read access to his Account asset"
participant(p): "org.acme.biznet.Seller"
operation: READ
resource(r): "org.acme.biznet.Account"
condition: (r.owner.getIdentifier() === p.getIdentifier())
action: ALLOW
}发布于 2018-03-25 18:10:19
如果你Account模型看起来像这样:
asset Account identified by accountId {
o String accountId
o String currency default="EUR"
--> Seller owner
o Double balance default=0.0
}则您当前的权限将生效。否则,您的权限中的条件需要进行如下更改:
condition: (r.ownerId == p.getIdentifier())发布于 2018-03-25 19:56:25
这就是我的解决方案:
//卖方对自己的空气污染数据资产具有读/写/更新访问权限
rule SellerAccessAirPollutionDataRecord {
description: "Allow sellers read/write/update access to own air pollution data assets"
participant(p): "org.acme.biznet.Seller"
operation: CREATE, UPDATE, READ
resource(r): "org.acme.biznet.AirPollutionData"
condition: (r.owner.getIdentifier() == p.getIdentifier())
action: ALLOW
}//卖方对已售出的空气污染数据资产具有读取权限
rule SellerReadAccessAirPollutionDataRecord {
description: "Allow sellers read access to sold air pollution data assets"
participant(p): "org.acme.biznet.Seller"
operation: READ
resource(r): "org.acme.biznet.AirPollutionData"
condition: (r.owner.getIdentifier() != p.getIdentifier())
action: ALLOW
}发布于 2018-08-03 12:21:48
卖方对帐户资产具有读取访问权限
rule SellerReadAccessAccountsRecord {
description: "Allow seller read access to his Account asset"
participant(p): "org.acme.biznet.Seller"
operation: READ
resource(r): "org.acme.biznet.Seller"
condition: (r.getIdentifier() == p.getIdentifier())
action: ALLOW
}有关更多信息,请查看here
https://stackoverflow.com/questions/49470208
复制相似问题