コード例 #1
0
 private function isAuthorized(FieldType $criteriaField)
 {
     /**@var AuthorizationChecker $security*/
     $security = $this->get('security.authorization_checker');
     $authorized = $security->isGranted($criteriaField->getMinimumRole());
     if ($authorized) {
         foreach ($criteriaField->getChildren() as $child) {
             $authorized = $security->isGranted($criteriaField->getMinimumRole());
             if (!$authorized) {
                 break;
             }
         }
     }
     return $authorized;
 }