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.'));
            }
        }
    }