Loopback $ owner不适用于findById

我想通过回送得到关于我的用户的一些信息。 为此,我创build了一个与“accessToken”模型相关的“用户”模型,直到现在POST on / user,POST on / user / login和POST on / user / logout正在工作。

我join/common/models/user.json

{ "name": "user", "base": "User", "idInjection": true, "options": { "validateUpsert": true }, "properties": {}, "validations": [], "relations": { "accessTokens": { "type": "hasMany", "model": "accessToken", "foreignKey": "userId" } }, "acls": [ { "accessType": "EXECUTE", "principalType": "ROLE", "principalId": "$authenticated", "permission": "ALLOW", "property": "logout" }, { "accessType": "EXECUTE", "principalType": "ROLE", "principalId": "$owner", "permission": "ALLOW", "property": "findById" } ], "methods": {} } 

当我在/ user / {id}上进行GET时,我得到:

 { "error": { "statusCode": 401, "name": "Error", "message": "Autorisation requise", "code": "AUTHORIZATION_REQUIRED", "stack": "Error: Autorisation requise\n at..." } } 

我想我不太了解acl /关系