【发布时间】:2014-07-27 12:19:45
【问题描述】:
我想检查是否为 Symfony2 中的特定用户(不是登录的用户)授予了角色。 我知道我可以通过以下方式检查登录用户:
$securityContext = $this->get('security.context');
if (false === $securityContext->isGranted('VIEW', $objectIdentity)) {
//do anything
}
但如果我是登录用户并且我想检查其他用户是否 isGranted ??
【问题讨论】: