Skip to content

Deserializer before security #1646

Description

@vincentchalamon

I have an ApiResource with an access control to ROLE_EMPLOYEE. When I send anonymously a request (with an iri of a non-existing object) to create an object, I get a 400, but I should receive a 403.

Entity:

/** * @ApiResource(attributes={ * "access_control"="is_granted('ROLE_EMPLOYEE')" * }) * … */class Shipping
{
/** * @var null|PsOrder * … */private$order;
}

Request:

{
"order": "/ps_orders/1"
}

Response: Item not found for "/ps_orders/1".

Maybe it's just a question of priority with DenyAccessListener that should be higher than DeserializeListener.

@api-platform/core-team What status code would you expect in this case: 400 or 401/403?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions