It was really difficult to come up with a working example because the documentation is not very clear on this issue and I am not that good with api platform yet so..., weaverryan what do you think of this solution? Do you have any suggestion…
…you!
I had a hard time to figure what was wrong with what I was doing. Actually, I didn't need the requestStack, but I needed to add "security_post_denormalize" in my Api Platform Configuration. Not sure I've understood why, though. Anyway, it…
…show the setup in the tutorial, but in the first chapter - https://symfonycasts.com/screencast/api-platform-extending/setup#project-setup - we mention that you should follow the README.md file in the code download to get things working. You might have just not seen…
…there is a bug in it with API Platform. Or, to be more fair to them, API Platform needed to make an update to fully support the new security system ... and they HAVE - https://github.com/api-platform/core/pull/3899 - but it has not…
…api-platform/core/blob/1607fc70c59caec7118949cc3425fbd0cf64eb90/src/Security/ResourceAccessChecker.php#L51
I've created an issue about this - https://github.com/api-platform/core/issues/3922. Unfortunately, until that's fixed, I don't think you'll be able to use the new system with API…
Hello. I have 2 groups to read:
* @ApiResource(
* normalizationContext={"groups"={"group:read","group_clear:read"}}
* )
By default works "group:read" context. How can I make a request to the api platform to get data in context "group_clear:read"?
…5",
"api-platform/core": "^2.5",
"symfony/framework-bundle": "5.1.*",
...
`
NOT working Entity/CheeseListing.php
`
/**
* @ApiResources(
* ...
* itemOperations={
* ...
* "put"={"security"=>"is_granted('ROLE_USER') and previous_object.getOwner() == user"}
* ...}
* ...
* )
*/
`
Working Entity/CheeseListing.php, due to https://api-platform.com/docs/core/security…
…2021, I am using Symfony's native testing tools (also, if you use API Platform, they have some nice add-ons onto the testing tools). Behat is really interesting, but I think, for most people, it's probably a bit overkill for API's. So…
Hey Ryan,
Oh yeah, now I see my mistake, I'm still using the `AutoGroupResourceMetadataFactory::getDefaultGroups` from https://symfonycasts.com/screencast/api-platform-security/resource-metadata-factory
While it has been deleted for the 3rd tutorial :)
Just disabled - everything works!
…work Symfony 5.2 - the `^5.1` in API Platform's composer.json allows 5.2. I would be curious if the bug lies in using Symfony 5.2 or API Platform 2.6 (my "instinct" is that it is in API Platform 2.6…
…the problem.
And, I don't think there is any "magic" fix... and I'm debating a few approaches in my mind. I would try this approach: https://symfonycasts.com/screencast/api-platform-extending/data-provider
Basically, create a new, non-persisted, `filteredCards` property on…
…step 3, which means at step 4 (in our transform() method) it's the perfect place to validate.
As I mentioned, the flow is complex because API Platform does a few things in the background, and we do a few things throughout that process. Hopefully…
Hi sridharpandu!
It sounds like you've done some excellent research! I am not personally responsible for API Platform and its docs, but I know the team that is, and I'm sure they would love any updates or improvements that you could make to…
Hello weaverryan !
I described the problem with more details in Stackoverflow question
https://stackoverflow.com/questions/65236214/api-platform-com-unsuported-media-type.
…
Hmm. You *will* need to add some config for API Platform - but it's pretty basic - https://github.com/symfony/recipes/blob/master/api-platform/core/2.5/config/packages/api_platform.yaml - and it doesn't include any "formats" config... you should get several…
…Joel L.
First, you will have to create a custom filter and hook it into the ApiPlatform system
https://api-platform.com/docs/core/filters/#creating-custom-filters
Then, you'll have to code the right query to perform the filtering you require. I believe…
…goes away". I still can't think of why this would happen, but this seems like the likely cause. There *is* a security difference between API Platform 2.4 and 2.5... but it's just a new feature. What I mean is, in 2…
…To explain:
With this setup : Docker + Traefik + Api Platform with Twig
Everything is on the same nginx container at this url api.mysite.localhost
login endpoint : api.mysite.localhost/login (symfony controller)
I followed your tutorial and first i implemented json_login and then switch…
…exceptions, and I can tell you that the access denied IS coming from API Platform. So, specifically, API Platform is looking at the "security" option of the current "operation" inside of the @ApiResource annotation (this can be specified at the root level of the resource…
…to me), but there is absolutely nothing wrong with it.
Could you describe your use-case a bit so I can recommend an approach? The example in API Platform - which uses a custom controller - is a bit ugly, but it works well. And it can…
x
1000+