diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-10-14 18:40:58 +0300 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-10-14 18:40:58 +0300 |
commit | a2f0a3650b03fcca3c8ca428ca1d2173197b4d22 (patch) | |
tree | 8d4c05cf0b74779fb37cb492bf4dd3bd653c614b /lib | |
parent | 2d0fcb4de23ab368e2e030b3cf7f6b1705ef676f (diff) | |
parent | 4117d9b310cbcdc1967163273ad63495542046cb (diff) | |
download | gitlab-ce-a2f0a3650b03fcca3c8ca428ca1d2173197b4d22.tar.gz |
Merge remote-tracking branch 'origin/cernvcs_hide_passwrd'
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/entities.rb | 12 | ||||
-rw-r--r-- | lib/api/services.rb | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 519072d0157..883a5e14b17 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -262,6 +262,18 @@ module API expose :notification_level end + class ProjectService < Grape::Entity + expose :id, :title, :created_at, :updated_at, :active + expose :push_events, :issues_events, :merge_requests_events, :tag_push_events, :note_events + # Expose serialized properties + expose :properties do |service, options| + field_names = service.fields. + select { |field| options[:include_passwords] || field[:type] != 'password' }. + map { |field| field[:name] } + service.properties.slice(*field_names) + end + end + class ProjectWithAccess < Project expose :permissions do expose :project_access, using: Entities::ProjectAccess do |project, options| diff --git a/lib/api/services.rb b/lib/api/services.rb index 6727e80ac1e..203f04a6259 100644 --- a/lib/api/services.rb +++ b/lib/api/services.rb @@ -57,7 +57,7 @@ module API # GET /project/:id/services/gitlab-ci # get ':id/services/:service_slug' do - present project_service + present project_service, with: Entities::ProjectService, include_passwords: current_user.is_admin? end end end |