diff options
author | Alexander Randa <randa.alex@gmail.com> | 2017-03-31 15:54:38 +0300 |
---|---|---|
committer | Alexander Randa <randa.alex@gmail.com> | 2017-06-02 19:44:36 +0300 |
commit | 3d70eeb5bb9dac8073a149547dc3b85c90d65e7d (patch) | |
tree | b925f3518e991df59a094ae9d7a6926241c9f5aa /app/serializers | |
parent | f07aee72bef4604312e11a43fce3a47865bce100 (diff) |
Implement ability to update deploy keys
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/deploy_key_entity.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/serializers/deploy_key_entity.rb b/app/serializers/deploy_key_entity.rb index d75a83d0fa5..068013c8829 100644 --- a/app/serializers/deploy_key_entity.rb +++ b/app/serializers/deploy_key_entity.rb @@ -11,4 +11,11 @@ class DeployKeyEntity < Grape::Entity expose :projects, using: ProjectEntity do |deploy_key| deploy_key.projects.select { |project| options[:user].can?(:read_project, project) } end + expose :can_edit + + private + + def can_edit + options[:user].can?(:update_deploy_key, object) + end end |