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.
Asked
Active
Viewed 69 times
1 Answers
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
-
Thanks. But tell me please where can I read more details about forming predicates rules? – konsul777 Mar 19 '18 at 19:27
-
In the security.yml file you find the link to the undertow documentation about predicates – Andrea Di Cesare Apr 05 '18 at 11:47