diff options
| author | Boyan Tabakov <boyan.tabakov@futurice.com> | 2013-07-31 13:52:23 +0300 |
|---|---|---|
| committer | Boyan Tabakov <boyan.tabakov@futurice.com> | 2013-09-29 11:47:29 +0300 |
| commit | 479631aafc525efef151309ac257e60c73230ac0 (patch) | |
| tree | 37861481ca8fe6c26f78aa2edee3df1c7156eacd /lib/api/entities.rb | |
| parent | cbb5b000c0c7593673683c08a402ea01a3a7f369 (diff) | |
| download | gitlab-ce-479631aafc525efef151309ac257e60c73230ac0.tar.gz | |
Extended User API to expose admin and can_create_group for user creation/updating.
Also, is_admin and can_create_group are exposed in the user information.
Fixed attributes_for_keys to process properly keys with boolean values (since false.present? is false).
Diffstat (limited to 'lib/api/entities.rb')
| -rw-r--r-- | lib/api/entities.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 1f35e9ec5fc..ab949f530ab 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -3,6 +3,9 @@ module API class User < Grape::Entity expose :id, :username, :email, :name, :bio, :skype, :linkedin, :twitter, :theme_id, :color_scheme_id, :state, :created_at, :extern_uid, :provider + expose :is_admin?, as: :is_admin + expose :can_create_group?, as: :can_create_group + expose :can_create_project?, as: :can_create_project end class UserSafe < Grape::Entity @@ -15,10 +18,6 @@ module API class UserLogin < User expose :private_token - expose :is_admin?, as: :is_admin - expose :can_create_group?, as: :can_create_group - expose :can_create_project?, as: :can_create_project - expose :can_create_team?, as: :can_create_team end class Hook < Grape::Entity |
