kor*_*ora 6 symfony
有人可以向我解释 :@Security("has_role("ROLE_ADMIN")")和 @Security("is_granted("ROLE_ADMIN")") 更推荐哪个之间的区别吗?
@Security("has_role("ROLE_ADMIN")")
@Security("is_granted("ROLE_ADMIN")")
fam*_*s23 6
在这种情况下,它们执行相同的工作,但has_role()自 Symfony 4.2 以来,安全表达式中的函数已被弃用,因此我们应该使用is_granted()它。
has_role()
is_granted()
归档时间:
5 年,2 月 前
查看次数:
236 次
最近记录: