0

In my project when a new user is creating, in the base creates a collection with the name as an user name. How should be correctly set permission section of file security.yml? In instance, creates a new user with name userid in the base 'auth/users' then creates a collection 'db/{userid}'. How can I set permission for this user userid only to the collection 'db/{userid}'? I know mongoDB have roles mechanism but I'm not at all understanding predicates mechanism in the restheart. I'm gratefull for any help.

konsul777
  • 11
  • 5

1 Answers1

0

You have an example in the security.yml file that come with restheart:

# Users with role 'users' can do anything on the collection /publicdb/{username}
- role: users
  predicate: path-template[value="/publicdb/{username}"] and equals[%u, "${username}"]
Andrea Di Cesare
  • 1,125
  • 6
  • 11