0
votes


i'm developing app with loopback & angular. I extened "user" modal in loopback into "puser" modal with some addi. fields('reportto').
Login & Register for the extended modal is working fine
But when i tried to use the method "find", its showing 401 Authorization required.
Code:

Puser.find({ filter : { where : { "reportto" : '639124805' } } }, function(success) { console.log(success); }, function(error) { console.log(error); });


Please chk the screenshot for req. header. enter image description here

Can anyone help on this?

1
please share the model configuration json of puser - idoshamun

1 Answers

2
votes

By default, loopback protects find method to be accessed only the owner rule. In order to change it you have to override the model configuration json. (for more information click here)

For example, to allow public access to all methods add the following acl:

"acls": [
    {
        "principalType": "ROLE",
        "principalId": "$everyone",
        "permission": "ALLOW"
    }
]