summaryrefslogtreecommitdiff
path: root/app/services/create_snippet_service.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@12-6-stable-eeGitLab Bot2019-12-201-1/+5
|
* Fix snippets API not working with visibility levelsh-fix-snippet-visibility-apiStan Hu2019-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | When a restricted visibility level of `private` is set in the instance, creating a snippet with the `visibility` level would always fail. This happened because: 1. `params[:visibility]` was a string (e.g. "public") 2. `CreateSnippetService` and `UpdateSnippetService` only looked at `params[:visibility_level]`, which was `nil`. To fix this, we: 1. Make `CreateSnippetService` look at the newly-built `snippet.visibility_level`, since the right value is assigned by the `VisibilityLevel#visibility=` method. 2. Modify `UpdateSnippetService` to handle both `visibility_level` and `visibility` parameters. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66050
* Record usage on snippet usageMark Chao2019-08-081-0/+1
| | | | Generalize wiki page counter for other page types to extend to.
* Enable frozen string in apps/uploaders/*.rbgfyoung2018-07-161-0/+2
| | | | Partially addresses #47424.
* Spam check and reCAPTCHA improvements28093-snippet-and-issue-spam-check-on-editOswaldo Ferreira2017-02-211-4/+6
|
* Check public snippets for spamSean McGivern2017-02-021-1/+8
| | | | | | Apply the same spam checks to public snippets (either personal snippets that are public, or public snippets on public projects) as to issues on public projects.
* Services: code style fixes, minor refactoringservices_refactoring1Valery Sizov2016-07-061-5/+5
|
* Tweaks, refactoring, and specsDouwe Maan2016-03-201-2/+1
|
* Enforce restricted visibilities for snippetsVinnie Okada2015-03-081-0/+20
Add new service classes to create and update project and personal snippets. These classes are responsible for enforcing restricted visibility settings for non-admin users.