Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
24276ed8
Commit
24276ed8
authored
Nov 04, 2014
by
Valeriy Sizov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8224 from liammonahan/master
Expose projects_limit through users API if UserFull.
parents
9cf50550
2edf212a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
doc/api/users.md
doc/api/users.md
+6
-3
lib/api/entities.rb
lib/api/entities.rb
+2
-1
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+1
-0
No files found.
doc/api/users.md
View file @
24276ed8
...
@@ -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
}
}
```
```
...
...
lib/api/entities.rb
View file @
24276ed8
...
@@ -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
...
...
spec/requests/api/users_spec.rb
View file @
24276ed8
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment