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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 10:08:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 10:08:36 +0300
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /app/controllers/projects/snippets_controller.rb
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/controllers/projects/snippets_controller.rb')
-rw-r--r--app/controllers/projects/snippets_controller.rb25
1 files changed, 4 insertions, 21 deletions
diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb
index 632e8db9796..779e149bb9c 100644
--- a/app/controllers/projects/snippets_controller.rb
+++ b/app/controllers/projects/snippets_controller.rb
@@ -7,16 +7,11 @@ class Projects::SnippetsController < Projects::Snippets::ApplicationController
before_action :check_snippets_available!
- before_action :snippet, only: [:show, :edit, :destroy, :update, :raw, :toggle_award_emoji, :mark_as_spam]
+ before_action :snippet, only: [:show, :edit, :raw, :toggle_award_emoji, :mark_as_spam]
- before_action :authorize_create_snippet!, only: [:new, :create]
- before_action :authorize_read_snippet!, except: [:new, :create, :index]
- before_action :authorize_update_snippet!, only: [:edit, :update]
- before_action :authorize_admin_snippet!, only: [:destroy]
-
- before_action do
- push_frontend_feature_flag(:snippet_multiple_files, current_user)
- end
+ before_action :authorize_create_snippet!, only: :new
+ before_action :authorize_read_snippet!, except: [:new, :index]
+ before_action :authorize_update_snippet!, only: :edit
def index
@snippet_counts = ::Snippets::CountService
@@ -37,14 +32,6 @@ class Projects::SnippetsController < Projects::Snippets::ApplicationController
@snippet = @noteable = @project.snippets.build
end
- def create
- create_params = snippet_params.merge(spammable_params)
- service_response = ::Snippets::CreateService.new(project, current_user, create_params).execute
- @snippet = service_response.payload[:snippet]
-
- handle_repository_error(:new)
- end
-
protected
alias_method :awardable, :snippet
@@ -53,8 +40,4 @@ class Projects::SnippetsController < Projects::Snippets::ApplicationController
def spammable_path
project_snippet_path(@project, @snippet)
end
-
- def snippet_params
- params.require(:project_snippet).permit(:title, :content, :file_name, :private, :visibility_level, :description)
- end
end