Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/ml/models_controller.rb')
-rw-r--r--app/controllers/projects/ml/models_controller.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/controllers/projects/ml/models_controller.rb b/app/controllers/projects/ml/models_controller.rb
new file mode 100644
index 00000000000..77855b73cbd
--- /dev/null
+++ b/app/controllers/projects/ml/models_controller.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module Projects
+ module Ml
+ class ModelsController < ::Projects::ApplicationController
+ before_action :check_feature_enabled
+ feature_category :mlops
+
+ def index
+ @models = ::Projects::Ml::ModelFinder.new(@project).execute
+ end
+
+ private
+
+ def check_feature_enabled
+ render_404 unless can?(current_user, :read_model_registry, @project)
+ end
+ end
+ end
+end