Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的项目中,当创建一个新用户时,在 base 中创建一个名称为用户名的集合。应该如何正确设置文件 security.yml 的权限部分?例如,在基础“auth/users”中创建一个名为userid的新用户,然后创建一个集合“db/{userid}”。如何将此用户用户 ID 的权限仅设置为集合 'db/{userid}'?我知道 mongoDB 有角色机制,但我根本不理解 restheart 中的谓词机制。我很感激任何帮助。
您在 restheart 附带的 security.yml 文件中有一个示例:
# Users with role 'users' can do anything on the collection /publicdb/{username} - role: users predicate: path-template[value="/publicdb/{username}"] and equals[%u, "${username}"]