Skip to content

Expose URI variables to Link security expression #8307

@rvanlaak

Description

@rvanlaak

Description

Follow-up of #8279

Also allow the current operation's uriVariables to all Link metadata class's security expressions.

Example

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,
        ),
    ],
),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions