請問我們知道ACL是否在操場上工作?ACL在操場上工作?
我想創建一個規則,資產的所有者只能修改規則。我在遊樂場嘗試,這是行不通的
我創建文件作爲資產和供應商作爲資產的所有者。然後,創建名爲file1的資產將supplier1作爲所有者。當我執行提交交易時,供應商2也可以修改交易。我的規則是無效的嗎?我需要一些更加不可思議的嗎?
/**
* New model file
*/
namespace org.acme.model
enum TransactionState {
o CREATED
o VERIFIED
}
asset File identified by fileId {
o String fileId
o String data
--> Supplier owner
o TransactionState state
}
participant Supplier identified by supplierId {
o String supplierId
o String emailId
o String details
}
transaction DataValidate {
--> File asset
o TransactionState state
--> Supplier supplier
}
/**
* Data Validation by Supplier
* @param {org.acme.model.DataValidate} dataValidate - the DataValidate transaction
* @transaction
*/
function DataValidate(dataValidate) {
dataValidate.asset.state = dataValidate.state;
return getAssetRegistry('org.acme.model.File')
.then(function (assetRegistry) {
return assetRegistry.update(dataValidate.asset);
});
}
rule Rule1 {
description: "can perform ALL operations , IF the participant is owner of the asset"
participant(m): "org.acme.model.Supplier"
operation: ALL
resource(v): "org.acme.model.File"
condition: (v.owner.getIdentifier() == m.getIdentifier())
action: ALLOW
}
rule Member {
description: "Allow the member read access"
participant: "org.acme.model.Supplier"
operation: READ
resource: "org.acme.model.*"
action: ALLOW
}
我的標準,數據驗證應該只由文件的所有者,而不是其他人。如何處理它