ACLがプレイグラウンドで動作するかどうかお知らせください。ACLはプレイグラウンドで動作しますか?
アセットの所有者がルールを変更できるだけのルールを作成したいとします。私は遊び場で試してみましたが、これは動作しません。
ファイルの作成者は、資産の所有者としてファイルを作成しました。次に、所有者としてsupplier1を添付したfile1という作成アセットを作成します。私が提出トランザクションを実行しているとき、Supplier2はトランザクションを変更することもできます。私のルールは有効ではありませんか?私はもう少し礼儀が必要ですか?
/**
* 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
}
私の判断基準では、データの検証はファイルの所有者だけが行ってください。どのようにそれを処理する