Sonata User - Security on custom field

前端 未结 2 661
逝去的感伤
逝去的感伤 2021-01-03 02:12

I used SonataUser with FOSUser to manage my users and created a custom field company to attach each one to a given company.

Now I\'d simply need to give

2条回答
  •  囚心锁ツ
    2021-01-03 02:33

    As I didn't need ACLs here, (only voters) I used the role security handler of sonata.

    But I had issues using it because its default implementation of isGranted() doesn't pass the current object to the voter.

    So I had to extend it, check my monologue in this github issue for more detail.


    By the way, my PR was accepted about this issue

提交回复
热议问题