用户的环回ACL - 不允许PUT请求

时间:2018-06-13 14:26:05

标签: node.js permissions authorization acl loopback

我配置了一个扩展名为User的基类Account的模型,并配置了身份验证思想AccessToken。现在,我想发出PUT请求,使用生成的access_token更改帐户详细信息,但API会不断拒绝授权错误的请求。

PUT http://0.0.0.0.0:3000/api/Accounts/14 X-Access-Token: *thetoken* { "about": "it's me here" }

{ "error": { "statusCode": 401, "name": "Error", "message": "Authorization Required", "code": "AUTHORIZATION_REQUIRED" } }

但帐户模型的ACL允许令牌所有者进行更改

"acls": [ { "accessType": "READ", "principalType": "ROLE", "principalId": "$everyone", "permission": "ALLOW" }, { "accessType": "EXECUTE", "principalType": "USER", "principalId": "$owner", "permission": "ALLOW" }, { "accessType": "WRITE", "principalType": "USER", "principalId": "$owner", "permission": "ALLOW" } ]

我不知道问题出在哪里。

0 个答案:

没有答案