Restrict a reviwer can only able to read the reviews for he is owner of ?
I was experimenting with this code for a time and i try to implement some like the below requirement.
Consider like there is no such option All Reviews.
A Reviewer can able to read only his own reviews and My Reviews will list out only the reviews which he is owner of
For that i changed the excisting ACLs with the below ACLs
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW",
"property": "create"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$owner",
"permission": "ALLOW"
},
{
"accessType": "WRITE",
"principalType": "ROLE",
"principalId": "$owner",
"permission": "ALLOW"
}
But after i execute the find reviews where publisherId={publisherId}, the result is a authorization error, http://localhost:3000/api/Reviews?filter=where publisherId="583b2d3bd7f0308f2054bfb9"
{
"error": {
"name": "Error",
"status": 401,
"message": "Authorization Required",
"statusCode": 401,
"code": "AUTHORIZATION_REQUIRED",
"stack": "Error: Authorization Required\n at /home/iss/Desktop/coderef/fbmashup/POC/loopback-getting-started-intermediate/node_modules/loopback/lib/application.js:399:21\n at ...............etc}
So how this is possible through Without any Custom Remote method
Please send a PR preferably with test cases.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.