I am trying to understand the loopback acl but failed, if I can use loopback acl control role authorization, what should I do?
When I get request
GET http://localhost:1337/api/Employees 401 (Unauthorized)
{
"error": {
"name": "Error",
"status": 401,
"message": "Authorization Required",
"statusCode": 401,
"stack": "Error: Authorization Required
}
}
Here is an employee. The JSON configuration
{
"name": "Employee",
"base": "User",
"properties": {
"nickname": {
"type": "string"
}
},
"validations": [],
"relations": {},
"acls": [
{
"principalType": "ROLE",
"principalId": "admin",
"permission": "ALLOW",
"accessType": "READ"
}
],
"methods": []
}
The following code is to add an employee
{
"nickname": "",
"realm": "",
"username": "",
"credentials": "object",
"challenges": "object",
"email": "",
"emailVerified": false,
"verificationToken": "",
"status": "",
"created": "",
"lastUpdated": "",
"id": 0
}
I don't know the inside of the loopback acls. How do I go to change To achieve access control effect?