【发布时间】:2012-12-08 05:24:36
【问题描述】:
官方ACL示例代码有效:http://symfony.com/doc/current/cookbook/security/acl.html
如果我这样做,没问题...
{% if is_granted('EDIT', comment) %}
Edit
{% endif %}
...但是如果我想要对关联对象的“授予访问权限”,它就行不通了。
{% for comment in news.comments %}
comment.content
{% if is_granted('EDIT', comment) %}
Edit
{% endif %}
{% endfor %}
我认为树枝扩展无法知道“评论”是“评论实体”。
查询搜索“Proxies\JblNewsBundleEntityCommentProxy”而不是“Jbl\NewsBundle\Entity\Comment”:
SELECT a.ancestor_id FROM acl_object_identities o INNER JOIN acl_classes c ON c.id = o.class_id INNER JOIN acl_object_identity_ancestors a ON a.object_identity_id = o.id WHERE ((o.object_identifier = '38' AND c.class_type = 'Proxies\\JblNewsBundleEntityCommentProxy'))
但我不知道如何解决这个问题。
请问你有解决办法吗?
【问题讨论】: