Skip to content

[idea] Voters/ACL & Data Transformer Support #202

@pierre-H

Description

@pierre-H

Hi,
First thank you for your great work : Api-Platform is awesome !!!

I'm asking if Api-Platform supports :

  1. Symfony's voter/acl : for example, with a Comment entity, I'd like to get only comments which the user can see. For example

  2. Data Transformer (in my case, i've got fields which are in rtf and I'd like to transform them in html and I've got already a Data Transformer for that but I'd like to apply it to Api Platform entity definition)

The first solution I've got is to use a Custom Data Provider but this is in my opinion heavy.

It would be so easy to have something like this :

  1. Voter/ACL :
@ApiPlatform(attributes={"isGranted": ".."})
class Comment {
...
}
  1. DataTransformer :
/**
 * @ApiPlatform\DataTransformer({"nameOfDataTransformer"})
 */
private $field;

I know that this is possible with Custom Data Provider, but I think these features could be useful...

Again, thank you for your great work !

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions