-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Field access control #178
Comments
i use this User:
type: object
config:
fields:
id:
type: "ID!"
builder: "Relay::GlobalId"
builderConfig:
typeName: User
username:
type: "String!"
deprecationReason: "Using e-mail only"
email:
type: "String!"
cards:
type: "[Card]"
resolve: "@=resolver('user_card_list', [value])"
access: "@=value === user" so you could use
|
OK, so the |
hi, in access mode you should use
|
need some documentation I think this part is not enough clear... |
but object is value of the field, so you cannot check the access as I and @pekarja5 need it |
@calvera that's right, my bad 👍 |
@mcg-web So, what is the proposed solution for this? In which cases the |
the solution of @calvera is the best but not sure it will work for mutation operation... Maybe this is not your use case. |
OK, thx |
i'm fine with this because mutation has no 'parent' entity |
I am trying to define field access control on my types, but I need to use the whole object for this decision, not only the value of protected field (which is accessible in expression by
object
).Example:
In my example I want to allow access to
description
property only for owner (based onuserId
) of theAdvert
object and to forbid it for all others. All other properties should remain accessible for all users.Is this possible using Expression language with available variables? Or I have to create custom resolvers, where I can check against this condition, for all my fields?
The text was updated successfully, but these errors were encountered: