【发布时间】:2018-06-25 13:04:11
【问题描述】:
我尝试使用 CouchDB 进行用户/角色身份验证(基于会话),但是一旦我在数据库中输入角色,所有用户和角色都可以访问数据库 -> 未经授权。
获取会话:
它返回(userCtx 对象):
{
"ok": true,
"name": "some_user_name",
"roles": [
"developers"
]
}
然后我将角色添加到数据库中:
{
"admins": {
"names": [],
"roles": []
},
"members": {
"names": [],
"roles": [
"developers"
]
}
}
它返回{"ok":true},我也可以在 fauxton 中看到权限。
当我现在尝试访问数据库时
它返回:
{
"error": "unauthorized",
"reason": "You are not authorized to access this db."
}
【问题讨论】:
标签: authentication permissions couchdb fauxton