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/experiments_controller.rb')
-rw-r--r--app/controllers/projects/ml/experiments_controller.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/projects/ml/experiments_controller.rb b/app/controllers/projects/ml/experiments_controller.rb
index a620e9919e7..85e7f63779c 100644
--- a/app/controllers/projects/ml/experiments_controller.rb
+++ b/app/controllers/projects/ml/experiments_controller.rb
@@ -5,7 +5,8 @@ module Projects
class ExperimentsController < ::Projects::ApplicationController
include Projects::Ml::ExperimentsHelper
- before_action :check_feature_enabled
+ before_action :check_read, only: [:show, :index]
+ before_action :check_write, only: [:destroy]
before_action :set_experiment, only: [:show, :destroy]
feature_category :mlops
@@ -55,10 +56,14 @@ module Projects
private
- def check_feature_enabled
+ def check_read
render_404 unless can?(current_user, :read_model_experiments, @project)
end
+ def check_write
+ render_404 unless can?(current_user, :write_model_experiments, @project)
+ end
+
def set_experiment
@experiment = ::Ml::Experiment.by_project_id_and_iid(@project.id, params[:iid])