I am building an app and I have a collection Order and I want to set permission,
it’s a multi hierarchy app which have Admin and Registered User and Anonymous user
Now I want to set roles like this,
Admin can do all crud operation,
User can read, Insert their own document but can’t delete or update.
Anonymous user can’t do any operation on Order document.
What I have achieved till is
Admin can read all and insert document.
Registered user can read but still not enable to insert.
Anonymous user can’t do any crud operation.
Although I have tried and partly successful to set permission but still not enable to set permission for User,
Hi Tyler thanks for the quick response I have tried that and after add write to true in filter,
User is enable to read as I already mention but not enable to insert
You can see the screenshot of the postman client. Please help out on this.
Having your insert permission as "%%user.identities.provider_type": "custom-token" is effectively always true given the apply_when is the same. This means that implicitly if this role is selected then insert is always true.
Write access implies read access. So I suspect you might also want to set “write” to be the same as “read” in the document_filters section.
Lastly, can you share with me the document you are trying to insert and possibly a link to the log in the UI?
This is the document to be inserted by the Registered User or Admin, anonymous user can’t do any operation on order collection. I have tried and changes so many things in permission object
but nothing work and I am reading fundamentals of permission from last three days, spending days and nights.
Hi, sorry you are not having a great experience. It would be nice if we provided better details about why permissions are rejecting a change, but that is technically speaking not something permissioning systems should do from a security perspective.
I notice that your rule references customer_id but your document has customerId. My hunch is that you need to modify your rule to reference customerId.
Hello Tyler thanks for being in touch
I am modifying and doing changes and what I learned I am just experimenting it.
Please take a look on this now and I also change customerId to customer_id
But getting the same result Register User can now insert but they can also read other Registered User documents which I don’t let them do.
I hope we will solve this puzzle
Hi Tyler I found an interesting thing I am getting 4 order out of 5 which is correct in UI or User Panel
but in postman I am still getting 5 order.
I think it is User Management or token related problem, but I am sending the same access token in postman.
You can see in the screenshot of Registered User Panel, Admin Panel and Postman Client
can put some light on this why is this happening, what point I am getting now is User Management Related issue, I still don’t know will this work full proof or not
Note, that it is not possible with our rules system currently to allow inserts but not updates. Inserts are a higher-priority operation so you can allow writes and not inserts, but you cannot do the opposite.
If you have any feedback for what can be clearer I would be happy to pass it along to the documentation team. Unfortunately in order to be as expressive as they are, rules can sometimes be a bit difficult to fully parse and understand.
Thanks for the supports, it’s working fine now but
it stuck in the update query as Register User needs to update the document
In the current Permission Admin can update the document but again when Register User
try to update it return into error.
I think it should work with the given permission but not working.