diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-03-29 22:19:00 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-03-30 10:44:20 +0200 |
commit | 949431fa02da18257c8b7c7a24c03faa04c02c5e (patch) | |
tree | 5f919610864b5d2709a6c48b3aab80d88608f968 /lib/api/entities.rb | |
parent | 26631f9981a826ebe4aeba726e9be2b813d2c5c5 (diff) | |
download | gitlab-ce-949431fa02da18257c8b7c7a24c03faa04c02c5e.tar.gz |
Update API to use notification_level from notification_setting
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r-- | lib/api/entities.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index f686c568bee..f414c1f9885 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -255,14 +255,19 @@ module API expose :id, :path, :kind end - class ProjectAccess < Grape::Entity + class Member < Grape::Entity expose :access_level - expose :notification_level + expose :notification_level do |member, options| + if member.notification_setting + NotificationSetting.levels[member.notification_setting.level] + end + end end - class GroupAccess < Grape::Entity - expose :access_level - expose :notification_level + class ProjectAccess < Member + end + + class GroupAccess < Member end class ProjectService < Grape::Entity |