2017-06-09 37 views
0

我不想給予參與者完全更新訪問權限,我想讓他更新對資產內特定財產的訪問權限。限制PUT訪問資產內的財產

從我從文檔中讀取的內容可以將規則應用於屬性。

規則

rule PatientAddMentor { 
    description: "A patient is allowed to add mentors" 
    participant(p): "nl.epd.blockchain.Patient" 
    operation: UPDATE 
    resource(m): "nl.epd.blockchain.MedicalFile.mentors" 
    condition: (m.owner.getIdentifier() == p.getIdentifier()) 
    action: ALLOW 
} 

我在哪裏停留在是如何定位的條件下資產的一部分。我假設(m)等於條件中的導師,因爲錯誤消息說參與者沒有更新權限。 (我不知道,如果它甚至有可能。)

型號:

namespace nl.epd.blockchain 

asset MedicalFile identified by bsn { 
    o String     bsn 
    --> Patient     owner 
    --> Patient[]    mentors optional 
    --> Organisation[]   organisations optional 
    o Visit[]     visits optional 
    o String[]     allergies optional 
    o Treatment[]    treatments optional 
    o Medicine[]    medicine optional 
} 

participant Patient identified by bsn { 
    o String bsn 
    o String firstName 
    o String namePrefix optional 
    o String lastName 
    o String email 
    o String telephoneNumber 
    o String birthday 
    o String gender 
    o String city 
    o String zipCode 
    o String street 
    o String houseNumber 
    o String houseNumberExtra optional 
} 

回答

1

的ACL引擎還沒有強制屬性級別的訪問控制(僅命名空間和類級別的訪問控制已實施) 。

您將不得不使用編程訪問控制使用getCurrentParticipant()運行時API,直到實現對屬性的聲明式訪問控制。