Iam just starting with Amazon Verified Permissions and doing some exercies. I created a schema for a Post entity with an attribute of type Entity referencing a User entity. I had to use the JSON editor as the visual editor does not support this type.
Here is my schema
{
"SampleForum": {
"actions": {
"Create": {
"appliesTo": {
"principalTypes": [
"User"
],
"resourceTypes": [
"Post"
]
}
},
"Edit": {
"appliesTo": {
"principalTypes": [
"User"
],
"resourceTypes": [
"Post"
]
}
},
"Delete": {
"appliesTo": {
"resourceTypes": [
"Post"
],
"principalTypes": [
"User"
]
}
}
},
"entityTypes": {
"Post": {
"shape": {
"type": "Record",
"attributes": {
"State": {
"type": "String",
"required": true
},
"Author": {
"name": "User",
"required": true,
"type": "Entity"
}
}
},
"memberOfTypes": []
},
"User": {
"memberOfTypes": [],
"shape": {
"attributes": {},
"type": "Record"
}
}
}
}
}
When iam now testing my policies in Test Bench i receive an error message telling me that the User entity is missing an id attribute.
Anyone can give me a clue on what iam doing wrong?
Thank you,
Stefan
Oh my bad. Actually my user was properly defined, but my policy was wrong. I had an attribute id before and matched the author with principal.id. I missed to changed the policy after i changed the schema. Nevertheless you answer led me into the right direction. Thanks.