我正在使用 Symfony Security/ACL 组件来检查一组“随机”用户对给定域对象的权限。
$article = ...; // domain object
$users = ...; // array of users
$oid = ObjectIdentity::fromDomainObject($article);
$sids = array();
for ($users as $user) {
$sids[] = UserSecurityIdentity::fromAccount($user);
}
$aclProvider = ...; // "security.acl.provider" service
$acl = $aclProvider->findAcl($oid, $sids);
但是,我无法检查是否为给定用户授予了给定权限。我怎样才能做到这一点?