diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-03-12 13:15:33 +0300 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2019-03-12 13:15:33 +0300 |
commit | 7e9348f3594ee158dfd4aaa9e03e5bb5dd36aead (patch) | |
tree | 74e03ba375331ab619a766d5d2a3c12aaa267095 /app/services | |
parent | db37b5a4c8d408e1bce0843162c609dcb1781188 (diff) |
Enable/disable Auto DevOps at Group level
- Includes instance methods on Group model to detect when a group has
AutoDevOps explicitly/implicitly enabled/disabled.
- Includes migration to add a new column to namespaces table
- Add UI necessary modifications
- Add service and controller to update auto devops
related instances
- Updates project and groups auto devops badges
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52447
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/groups/auto_devops_service.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/services/groups/auto_devops_service.rb b/app/services/groups/auto_devops_service.rb new file mode 100644 index 00000000000..1925e0cc0ea --- /dev/null +++ b/app/services/groups/auto_devops_service.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Groups + class AutoDevopsService < Groups::BaseService + def execute + raise Gitlab::Access::AccessDeniedError unless can?(current_user, :admin_group, group) + + group.update(auto_devops_enabled: auto_devops_enabled) + end + + private + + def auto_devops_enabled + params[:auto_devops_enabled] + end + end +end |