api-platform / api-platform/core
Expose URI variables to Link security expression
Open
- Dominant language
- PHP
- Stars
- 2.6k
- Forks
- 980
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 48
Description
**Description**
Follow-up of https://github.com/api-platform/core/pull/8279
Also allow the current operation's `uriVariables` to all Link metadata class's security expressions.
**Example**
```php
new Get(
uriTemplate: '/foo/{id}/bar/{name}',
uriVariables: [
'id' => new Link(
fromClass: Bar::class,
security: "is_granted('ROLE_USER') and bar.id === user.bar.id and name !== 'admin-bar'",
securityObjectName: 'bar',
provider: ReadLinkParameterProvider::class,
required: true,
),
],
),
Contributor guide
Assessment
This issue has not been assessed yet.