Skip to content

Where voters should be put? #29

@lobodol

Description

@lobodol

Hello there,

I discovered recently the talk you gave at the AFUP where you mention this repository.
Amazing work, very inspiring.

While going through your code, I couldn't find anything regarding access policies.
Saying that "The user must be the owner of the resource X to edit it" is business logic. Therefore I would be tempted to create an access policy object in the domain layer, that I would use in the edit-X-use-case. Then, leveraging Symfony, I would create a Voter that would basically use the access-policy-object from the domain layer and use that voter in the dedicated Symfony controller.

What do you think of this approach?

Regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions