BigW Consortium Gitlab

Commit 24276ed8 by Valeriy Sizov

Merge pull request #8224 from liammonahan/master

Expose projects_limit through users API if UserFull.
parents 9cf50550 2edf212a
......@@ -78,7 +78,8 @@ GET /users
"is_admin": false,
"avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg",
"can_create_group": true,
"can_create_project": true
"can_create_project": true,
"projects_limit": 100
}
]
```
......@@ -140,7 +141,8 @@ Parameters:
"color_scheme_id": 2,
"is_admin": false,
"can_create_group": true,
"can_create_project": true
"can_create_project": true,
"projects_limit": 100
}
```
......@@ -240,7 +242,8 @@ GET /user
"color_scheme_id": 2,
"is_admin": false,
"can_create_group": true,
"can_create_project": true
"can_create_project": true,
"projects_limit": 100
}
```
......
......@@ -16,7 +16,8 @@ module API
class UserFull < User
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_project?, as: :can_create_project
end
......
......@@ -433,6 +433,7 @@ describe API::API, api: true do
json_response['is_admin'].should == user.is_admin?
json_response['can_create_project'].should == user.can_create_project?
json_response['can_create_group'].should == user.can_create_group?
json_response['projects_limit'].should == user.projects_limit
end
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