-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feature Request - field level @auth rules #8169
Comments
From community: Just an additional note on the necessity of field level auth:An important use case for this is the ability to add comments to a post where the post has a field:
If any user has update access to the post, the user is able to modify the whole post. Otherwise they are unable to add a comment to the post. The @auth directive could prove as an extremely powerful tool in allowing end users to access data from dgraph, and considering update-after-auth and field level updates are mentioned frequently, it seems an upheaval of the @auth directive is likely a necessity. Not ignoring of course the fact that the existing interface is clunky at best, and could be prone to errors in development. The redevelopment of this is also beneficial, fiscally, for dgraph cloud, as if the @auth directive could be relied upon for all user access auth, it will reduce the need for purpose built API interfaces to be built on top of dgraph, allowing total public access to the dgraph DB. This in turn would increase the number requests made to the server... just a thought. |
This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open. |
https://discuss.dgraph.io/t/how-to-achieve-field-level-auth-at-the-moment/13069
https://discuss.dgraph.io/t/using-auth-on-individual-fields/7208
Currently there is no way to secure a field differently than the entire type.
I have seen around 5 people leave DGraph due to this missing feature alone.
Example 1
Let's say I have:
I can use Auth Rules to prevent users from adding and updating the type. But what if I want to allow users to edit a certain field, and only a certain field.
If a user votes, they need to add a connection in the
votes
type. They should not have access to the other fields.Example 2
The opposite example is preventing a user from editing a field in a post:
Let's say the role is
User
. I should not allow a regular user to update their own role toAdmin
.The theoretical fix would be to have something like this:
Security makes and breaks DGraph for a lot of users, and this is one of the important ones.
J
The text was updated successfully, but these errors were encountered: