I created a Model named "ShippingAddresses" which has following ACL rules.
[
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$owner",
"permission": "ALLOW"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW",
"property": "create"
},
{
"accessType": "WRITE",
"principalType": "ROLE",
"principalId": "$owner",
"permission": "ALLOW"
}
]
When I create a record by making a POST call on endpoint /api/shipping_addresses it works perfectly fine but when I make a GET request on same endpoint /api/shipping_addresses it's not working.
Also, just for side note, I have ShippingAddresses model's relation defined with Account (inherits User). Relation is: User -> hasMany ShippingAddress , ShippingAddress -> belongsTo Account.
I read ACL documentation on Loopback Official docs but I'm lost. Everything seems to set correctly but still getting 401: Authorization Required.