gitlab-org--gitlab-foss/lib
Timothy Andrew 0a8aeb46dc Use `Gitlab::Access` to protected branch access levels.
1. It makes sense to reuse these constants since we had them duplicated
   in the previous enum implementation. This also simplifies our
   `check_access` implementation, because we can use
   `project.team.max_member_access` directly.

2. Use `accepts_nested_attributes_for` to create push/merge access
   levels. This was a bit fiddly to set up, but this simplifies our code
   by quite a large amount. We can even get rid of
   `ProtectedBranches::BaseService`.

3. Move API handling back into the API (previously in
   `ProtectedBranches::BaseService#translate_api_params`.

4. The protected branch services now return a `ProtectedBranch` rather
   than `true/false`.

5. Run `load_protected_branches` on-demand in the `create` action, to
   prevent it being called unneccessarily.

6. "Masters" is pre-selected as the default option for "Allowed to Push"
   and "Allowed to Merge".

7. These changes were based on a review from @rymai in !5081.
2016-07-29 15:20:39 +05:30
..
api Use `Gitlab::Access` to protected branch access levels. 2016-07-29 15:20:39 +05:30
assets
backup Fix backup restore 2016-07-25 06:23:07 -07:00
banzai Ensure relative paths for video are rewritten as we do for images 2016-07-26 10:22:17 +02:00
ci Improve code design 2016-07-19 14:58:17 +02:00
container_registry Make rubocop happy 2016-07-15 18:05:39 +02:00
gitlab Enforce "No One Can Push" during git operations. 2016-07-29 15:20:39 +05:30
json_web_token
omni_auth
rouge/formatters use %(...) and %[...] in favor of %<...> 2016-07-14 22:43:49 -07:00
support Defend against 'Host' header injection 2016-07-12 19:50:20 +02:00
tasks Merge branch 'simple-cov' into 'master' 2016-07-27 16:42:07 +00:00
banzai.rb Object renderer read_multi rendered entries from Cache 2016-07-12 14:35:29 +02:00
disable_email_interceptor.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
event_filter.rb
extracts_path.rb
file_size_validator.rb
file_streamer.rb
gitlab.rb Update `Gitlab.com?` to support staging 2016-06-27 15:10:36 -04:00
gt_one_coercion.rb
repository_cache.rb Use project ID in repository cache to prevent stale data from persisting across projects 2016-07-25 05:09:28 -07:00
static_model.rb
unfold_form.rb
uploaded_file.rb Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
version_check.rb