我有一条规则:
rule Viewer {
description: "Allow the viewer read access to his assigned assets"
participant(v): "org.biz.app.Viewer"
operation: READ
resource(d): "org.biz.app.Activo"
condition: (v.getIdentifier() === d.viewers.getIdentifier())
action: ALLOW
}
在模型文件中:
asset Activo identified by acitvoId {
o String activoId
o String activoName
o Integer version
o DateTime startDate
o DateTime endDate
--> Author owner
--> Viewer[] viewers optional
}
我想要的规则是,查看器只对分配给他的资产具有读取权限。
这个:
v.getIdentifier();
--> Viewer[] viewers optional
如果viewerid在数组中,则查看器具有读取权限。我该怎么写那个规则?