Use can? on ::Ml Controllers
What does this MR do and why?
Refactors CandidatesController and ExperimentsController to use the read_model_experiments permission instead of only checking the feature flag.
This is MR is part of adding the visilibility to Model experiments. To check the change in this MR in the full, context, refer to !121396 (closed)
How to set up and validate locally
-
Pick a project
-
Navigate to
/-/ml/experiments
. It should show 404 -
Enable the feature flag on rails console:
echo "Feature.enable(:ml_experiment_tracking)" | bundle exec rails c
-
Navigate to
/-/ml/experiments
. It should the experiments page with an empty state -
Disable model experiments on rails console (id is the id of the project you are testing)
ProjectFeature.where(project_id: id).first.update!(model_experiments_access_level: 0)
-
Navigate to
/-/ml/experiments
. It should show 404
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #412384 (closed)