summaryrefslogtreecommitdiff
path: root/app/services/keys/destroy_service.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-05-16 20:26:22 +0200
committerRémy Coutable <remy@rymai.me>2018-05-16 20:26:22 +0200
commit6d81905fafb23f20520eb5ffa46c94b18ccc8686 (patch)
treee265085fa9378a96ddcbae0d51e3f3cdb3de5b8e /app/services/keys/destroy_service.rb
parentc75ae23729771869591b6bc4f1528581d3bfe999 (diff)
downloadgitlab-ce-6d81905fafb23f20520eb5ffa46c94b18ccc8686.tar.gz
Introduce a new Keys::DestroyService service
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/services/keys/destroy_service.rb')
-rw-r--r--app/services/keys/destroy_service.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/services/keys/destroy_service.rb b/app/services/keys/destroy_service.rb
new file mode 100644
index 00000000000..785cfa3a1d8
--- /dev/null
+++ b/app/services/keys/destroy_service.rb
@@ -0,0 +1,12 @@
+module Keys
+ class DestroyService < ::Keys::BaseService
+ def execute(key)
+ key.destroy if destroy_possible?(key)
+ end
+
+ # overriden in EE::Keys::DestroyService
+ def destroy_possible?(key)
+ true
+ end
+ end
+end