How to temporarily disable particular user in couchdb?

∥☆過路亽.° 提交于 2021-01-28 12:22:33

问题


I need a way to temporarily disable particular user read/write access to my couchdb, i.e. ban him there for certain period of time, but letting him know that he was banned. What could be the best approach to do it?

The very first thing came to my mind was just changing his password (require_valid_user is set), but this way there definitely will be no feedback to him as his access is completely lost.

My DBs have role-based access set up, all regular users are assigned to role "registered", so my second thought was to change his role to something like "banned" => he loses access to all regular DBs. But how to provie feedback in such case?

_users DB as well has "registered" role for access (is that necessary, BTW?) will it prevent user with role "banned" to read his own doc from there?


回答1:


In case somebody stepped down here for similar task. =>solution: Finally I ended up with server logic that changes user role to "banned" and adding this role to access roles of _users DB. This way banned user completely loses his access to other DBs (which request "registered" role) and has to wait until server changes his role back to valid one.



来源:https://stackoverflow.com/questions/56919356/how-to-temporarily-disable-particular-user-in-couchdb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!