Commit 2edf212a authored by Liam Monahan's avatar Liam Monahan

Expose projects_limit through users API if UserFull.

parent e9171fea
...@@ -78,7 +78,8 @@ GET /users ...@@ -78,7 +78,8 @@ GET /users
"is_admin": false, "is_admin": false,
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
"can_create_group": true, "can_create_group": true,
"can_create_project": true "can_create_project": true,
"projects_limit": 100
} }
] ]
``` ```
...@@ -140,7 +141,8 @@ Parameters: ...@@ -140,7 +141,8 @@ Parameters:
"color_scheme_id": 2, "color_scheme_id": 2,
"is_admin": false, "is_admin": false,
"can_create_group": true, "can_create_group": true,
"can_create_project": true "can_create_project": true,
"projects_limit": 100
} }
``` ```
...@@ -240,7 +242,8 @@ GET /user ...@@ -240,7 +242,8 @@ GET /user
"color_scheme_id": 2, "color_scheme_id": 2,
"is_admin": false, "is_admin": false,
"can_create_group": true, "can_create_group": true,
"can_create_project": true "can_create_project": true,
"projects_limit": 100
} }
``` ```
......
...@@ -16,7 +16,8 @@ module API ...@@ -16,7 +16,8 @@ module API
class UserFull < User class UserFull < User
expose :email expose :email
expose :theme_id, :color_scheme_id, :extern_uid, :provider expose :theme_id, :color_scheme_id, :extern_uid, :provider, \
:projects_limit
expose :can_create_group?, as: :can_create_group expose :can_create_group?, as: :can_create_group
expose :can_create_project?, as: :can_create_project expose :can_create_project?, as: :can_create_project
end end
......
...@@ -433,6 +433,7 @@ describe API::API, api: true do ...@@ -433,6 +433,7 @@ describe API::API, api: true do
json_response['is_admin'].should == user.is_admin? json_response['is_admin'].should == user.is_admin?
json_response['can_create_project'].should == user.can_create_project? json_response['can_create_project'].should == user.can_create_project?
json_response['can_create_group'].should == user.can_create_group? json_response['can_create_group'].should == user.can_create_group?
json_response['projects_limit'].should == user.projects_limit
end end
it "should return 401 error if user is unauthenticated" do it "should return 401 error if user is unauthenticated" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment