如何临时禁用Couchdb中的特定用户? [英] How to temporarily disable particular user in couchdb?

查看:27
本文介绍了如何临时禁用Couchdb中的特定用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种方法来临时禁止特定用户对我的beddb的读/写访问,即在一段时间内禁止他到那里,但要让他知道他被禁止了.最好的方法是什么?

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?

我想到的第一件事就是更改密码(已设置require_valid_user),但是由于完全失去了访问权限,因此这种方式肯定不会给他任何反馈.

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.

我的数据库具有基于角色的访问权限,所有常规用户都分配了已注册"角色,所以我的第二个想法是将其角色更改为禁止" =>他失去了对所有常规DB的访问权限.但是在这种情况下如何提供反馈呢?

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数据库也具有注册"角色以进行访问(这是必需的,顺便说一句吗?)是否会阻止具有禁止"角色的用户从那里读取自己的文档?

_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?

推荐答案

以防有人下台执行类似任务.=>解决方案:最终,我得到了服务器逻辑,该逻辑将用户角色更改为禁止",并添加了该角色以访问_users DB的角色.这样,被禁用户将完全失去对其他数据库的访问权限(请求已注册"角色),并且必须等到服务器将其角色更改回有效的角色.

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.

这篇关于如何临时禁用Couchdb中的特定用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆