Skip to content

Commit

Permalink
Support APIPlatform 2.5 by searching security keyword in resource met…
Browse files Browse the repository at this point in the history
…adata
  • Loading branch information
yannj committed Jun 19, 2020
1 parent 2e62a4a commit 41e04a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"symfony/dependency-injection": "^4.0|^5.0",
"symfony/http-kernel": "^4.0|^5.0",
"symfony/routing": "^4.0|^5.0",
"api-platform/core": ">=2.1.0 <2.5.0"
"api-platform/core": "^2.5"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/AccessControl/RouteAccessControlFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function getAccessControlExpressionForApiPlatform(Route $route): strin
try {
$resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);
$attributes = AttributesExtractor::extractAttributes($route->getDefaults());
$isGranted = $resourceMetadata->getOperationAttribute($attributes, 'access_control', null, true);
$isGranted = $resourceMetadata->getOperationAttribute($attributes, 'security', null, true);
if (null === $isGranted) {
$isGranted = RouteAccessControlData::NO_ACCESS_CONTROL;
}
Expand Down

0 comments on commit 41e04a9

Please sign in to comment.