gitlab-org--gitlab-foss/app/services/groups
Stan Hu 680f437715 Fix snippets API not working with visibility level
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
2019-08-28 22:49:58 -07:00
..
auto_devops_service.rb
base_service.rb
create_service.rb Fix snippets API not working with visibility level 2019-08-28 22:49:58 -07:00
destroy_service.rb
nested_create_service.rb Remove code related to object hierarchy in MySQL 2019-07-25 15:35:06 +08:00
transfer_service.rb Remove code related to object hierarchy in MySQL 2019-07-25 15:35:06 +08:00
update_service.rb Allow disabling group/project email notifications 2019-08-15 17:37:36 +00:00