Symfony2:如何获取标记为“EDIT"的一种类型的所有实体ACL 权限?

2022-01-16 00:00:00 acl php symfony doctrine entitymanager

有人能告诉我如何获取一种类型的所有实体,这些实体都标有EDIT"ACL 权限吗?

Can someone tell me how to get all entities of one type which are marked with "EDIT" ACL permission?

我想用 Doctrine EntityManager 构建一个查询.

I would like to build a query with the Doctrine EntityManager.

推荐答案

我不相信有这样做的默认方式.您可以做的是编写自己的服务,将 Filter 添加到您的 Doctrine DQL 查询中.

I don't believe there's a default way of doing this. What you could do is to write your own service that adds a Filter to your Doctrine DQL queries.

有关详细信息,请参阅:

For more info, see:

  • https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/reference/filters.html
  • https:///www.doctrine-project.org/projects/doctrine-orm/en/2.7/cookbook/dql-custom-walkers.html

希望这会有所帮助!

相关文章