diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-02 16:12:41 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-02 16:12:41 +0900 |
commit | a41fb7b22908547f8b846cd7963586acb02ef753 (patch) | |
tree | 2255085eafc45a55ed9c31f3edc999f097e99636 /app/services | |
parent | 1427bdcadf5f4026d141a5c4e93db8b1b00fe40a (diff) | |
parent | e54dd249aa7abcdd2c6c888f45399028cb64bb97 (diff) | |
download | gitlab-ce-a41fb7b22908547f8b846cd7963586acb02ef753.tar.gz |
Merge branch 'master' into refactor-clusters
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/projects/group_links/create_service.rb | 15 | ||||
-rw-r--r-- | app/services/projects/group_links/destroy_service.rb | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/app/services/projects/group_links/create_service.rb b/app/services/projects/group_links/create_service.rb new file mode 100644 index 00000000000..35624577024 --- /dev/null +++ b/app/services/projects/group_links/create_service.rb @@ -0,0 +1,15 @@ +module Projects + module GroupLinks + class CreateService < BaseService + def execute(group) + return false unless group + + project.project_group_links.create( + group: group, + group_access: params[:link_group_access], + expires_at: params[:expires_at] + ) + end + end + end +end diff --git a/app/services/projects/group_links/destroy_service.rb b/app/services/projects/group_links/destroy_service.rb new file mode 100644 index 00000000000..fbf31214c28 --- /dev/null +++ b/app/services/projects/group_links/destroy_service.rb @@ -0,0 +1,10 @@ +module Projects + module GroupLinks + class DestroyService < BaseService + def execute(group_link) + return false unless group_link + group_link.destroy + end + end + end +end |