Failed to configure permission role in RavenDB

looking for some help or a blog post really relating to using the auth package with RavenDB ..

using the HelloWorld example: http://ravendb.net/tutorials/hello-world I'm trying to disconnect a user from requests for orders .. I tried different approaches to roles, but I can't get this damn job.

currently I: * created an authorization user * created an authorization role

Id: Authorization/Roles/Orders { "Permissions": [ { "Operation": "order/1", "Tags": [ "Orders" ], "Allow": false, "Priority": 1 } ] } ID: Authorization/Users/ayende { "Name": "Ayende Rahien", "Roles": [ "Authorization/Roles/Orders" ] } 

I just canโ€™t understand how to filter orders from requests. for example, a request for orders / 1 will return order 1 before applying the permission.

after use:

 session.SecureFor("Authorization/Users/ayende", "orders/1"); 

I would expect orders to not return any orders.

Do I have this concept completely wrong or is my resolution simply configured incorrectly?

thanks

+4
source share
2 answers

Did you attach your permission to the document and then call SaveChanges? Maybe if you post your code, itโ€™s easier to say what is happening.

0
source

You can use the IsAllowed method to check whether you have access to the document or now, but also to check why you / cannot access the document.

+1
source

Source: https://habr.com/ru/post/1381899/


All Articles