Skip to content

[GraphQL] Security #471

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

Merged
merged 2 commits into from
May 1, 2018
Merged

[GraphQL] Security #471

merged 2 commits into from
May 1, 2018

Conversation

alanpoulain
Copy link
Member

No description provided.

core/graphql.md Outdated
If your security needs differ between REST and GraphQL, add the particular parts in the `graphql` key.

In the example below, we want the same security rules as in REST, but we also want to allow an admin to delete a book in GraphQL only.
Please note it's not possible to update a book in GraphQL because the operation is not defined.
Copy link
Member

@soyuka soyuka Apr 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that ... because the operation update is not enabled defined.

core/graphql.md Outdated
@@ -59,7 +60,10 @@ use ApiPlatform\Core\Annotation\ApiResource;
* graphql={
* "query"={
* "filters"={"offer.date_filter"}
* }
* },
* "delete"={},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax "delete", "update", "create" should work IIRC.

core/graphql.md Outdated
@@ -68,3 +72,42 @@ class Offer
// ...
}
```

## Security (access_control)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`access_control`

@alanpoulain
Copy link
Member Author

Fixed.

@soyuka soyuka merged commit 89138fe into api-platform:2.2 May 1, 2018
@soyuka
Copy link
Member

soyuka commented May 1, 2018

thanks @alanpoulain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants