private function checkAccess($modelClass, $keys, $operation)
    {
        $models = $modelClass::findAll($keys);
        foreach ($models as $model) {
            if (!Yii::$app->user->can("{$modelClass}.{$operation}", ['model' => $model])) {
                throw new ForbiddenHttpException(Yii::t('app', 'Access denied.'));
            }
        }
    }
private function checkAccess($modelClass, $keys, $operation)
    {
        $models = $modelClass::findAll($keys);
        foreach ($models as $model) {
            if (!Yii::$app->user->can("{$modelClass}.{$operation}", ['model' => $model])) {
                throw new ForbiddenHttpException(Yii::t('app', 'Access denied.'));
            }
        }
    }
private function checkAccess ( $ modelClass , $ keys , $ operation ) { $ models = $ modelClass :: findAll ( $ keys ) ; foreach ( $ models as $ model ) { if ( ! Yii :: $ app -> user -> can ( "{$modelClass}.{$operation}" , [ 'model' => $ model ] ) ) { throw new ForbiddenHttpException ( Yii :: t ( 'app' , 'Access denied.' ) ) ; } } }
Checks access for multiple models.

@param string $modelClass
@param array $keys
@param string $operation
@throws ForbiddenHttpException
Checks access for multiple models .