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
Léo-Paul Géneau
gitlab-ce
Commits
801e870d
Commit
801e870d
authored
Apr 06, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'api-user-location' into 'master'
Expose user location in API * Closes #14720 See merge request !3558
parents
26f51bb0
62b69632
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
3 deletions
+12
-3
CHANGELOG
CHANGELOG
+1
-0
doc/api/users.md
doc/api/users.md
+6
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-1
lib/api/users.rb
lib/api/users.rb
+4
-2
No files found.
CHANGELOG
View file @
801e870d
...
...
@@ -24,6 +24,7 @@ v 8.7.0 (unreleased)
- Improved UX of the navigation sidebar
- Build status notifications
- API: Ability to retrieve a specific tag (Robert Schilling)
- API: Expose user location (Robert Schilling)
v 8.6.5 (unreleased)
- Check permissions when user attempts to import members from another project
...
...
doc/api/users.md
View file @
801e870d
...
...
@@ -69,6 +69,7 @@ GET /users
"state"
:
"blocked"
,
"created_at"
:
"2012-05-23T08:01:01Z"
,
"bio"
:
null
,
"location"
:
null
,
"skype"
:
""
,
"linkedin"
:
""
,
"twitter"
:
""
,
...
...
@@ -126,6 +127,7 @@ Parameters:
"created_at"
:
"2012-05-23T08:00:58Z"
,
"is_admin"
:
false
,
"bio"
:
null
,
"location"
:
null
,
"skype"
:
""
,
"linkedin"
:
""
,
"twitter"
:
""
,
...
...
@@ -154,6 +156,7 @@ Parameters:
"confirmed_at"
:
"2012-05-23T08:00:58Z"
,
"last_sign_in_at"
:
"2015-03-23T08:00:58Z"
,
"bio"
:
null
,
"location"
:
null
,
"skype"
:
""
,
"linkedin"
:
""
,
"twitter"
:
""
,
...
...
@@ -191,6 +194,7 @@ Parameters:
-
`extern_uid`
(optional) - External UID
-
`provider`
(optional) - External provider name
-
`bio`
(optional) - User's biography
-
`location`
(optional) - User's location
-
`admin`
(optional) - User is admin - true or false (default)
-
`can_create_group`
(optional) - User can create groups - true or false
-
`confirm`
(optional) - Require confirmation - true (default) or false
...
...
@@ -218,6 +222,7 @@ Parameters:
-
`extern_uid`
- External UID
-
`provider`
- External provider name
-
`bio`
- User's biography
-
`location`
(optional) - User's location
-
`admin`
(optional) - User is admin - true or false (default)
-
`can_create_group`
(optional) - User can create groups - true or false
-
`external`
(optional) - Flags the user as external - true or false(default)
...
...
@@ -260,6 +265,7 @@ GET /user
"state"
:
"active"
,
"created_at"
:
"2012-05-23T08:00:58Z"
,
"bio"
:
null
,
"location"
:
null
,
"skype"
:
""
,
"linkedin"
:
""
,
"twitter"
:
""
,
...
...
lib/api/entities.rb
View file @
801e870d
...
...
@@ -15,7 +15,7 @@ module API
class
User
<
UserBasic
expose
:created_at
expose
:is_admin?
,
as: :is_admin
expose
:bio
,
:skype
,
:linkedin
,
:twitter
,
:website_url
expose
:bio
,
:
location
,
:
skype
,
:linkedin
,
:twitter
,
:website_url
end
class
Identity
<
Grape
::
Entity
...
...
lib/api/users.rb
View file @
801e870d
...
...
@@ -58,6 +58,7 @@ module API
# extern_uid - External authentication provider UID
# provider - External provider
# bio - Bio
# location - Location of the user
# admin - User is admin - true or false (default)
# can_create_group - User can create groups - true or false
# confirm - Require user confirmation - true (default) or false
...
...
@@ -67,7 +68,7 @@ module API
post
do
authenticated_as_admin!
required_attributes!
[
:email
,
:password
,
:name
,
:username
]
attrs
=
attributes_for_keys
[
:email
,
:name
,
:password
,
:skype
,
:linkedin
,
:twitter
,
:projects_limit
,
:username
,
:bio
,
:can_create_group
,
:admin
,
:confirm
,
:external
]
attrs
=
attributes_for_keys
[
:email
,
:name
,
:password
,
:skype
,
:linkedin
,
:twitter
,
:projects_limit
,
:username
,
:bio
,
:
location
,
:
can_create_group
,
:admin
,
:confirm
,
:external
]
admin
=
attrs
.
delete
(
:admin
)
confirm
=
!
(
attrs
.
delete
(
:confirm
)
=~
(
/(false|f|no|0)$/i
))
user
=
User
.
build_user
(
attrs
)
...
...
@@ -106,6 +107,7 @@ module API
# website_url - Website url
# projects_limit - Limit projects each user can create
# bio - Bio
# location - Location of the user
# admin - User is admin - true or false (default)
# can_create_group - User can create groups - true or false
# external - Flags the user as external - true or false(default)
...
...
@@ -114,7 +116,7 @@ module API
put
":id"
do
authenticated_as_admin!
attrs
=
attributes_for_keys
[
:email
,
:name
,
:password
,
:skype
,
:linkedin
,
:twitter
,
:website_url
,
:projects_limit
,
:username
,
:bio
,
:can_create_group
,
:admin
,
:external
]
attrs
=
attributes_for_keys
[
:email
,
:name
,
:password
,
:skype
,
:linkedin
,
:twitter
,
:website_url
,
:projects_limit
,
:username
,
:bio
,
:
location
,
:
can_create_group
,
:admin
,
:external
]
user
=
User
.
find
(
params
[
:id
])
not_found!
(
'User'
)
unless
user
...
...
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