Merge branch 'master' into fixes/api, code clean up and tests fixed
Conflicts: doc/api/projects.md spec/requests/api/projects_spec.rb
This commit is contained in:
commit
3374027e3a
49 changed files with 820 additions and 163 deletions
|
@ -81,6 +81,26 @@ module Gitlab
|
|||
end
|
||||
end
|
||||
|
||||
# Add ssh key to a specified user. Only available to admin users.
|
||||
#
|
||||
# Parameters:
|
||||
# id (required) - The ID of a user
|
||||
# key (required) - New SSH Key
|
||||
# title (required) - New SSH Key's title
|
||||
# Example Request:
|
||||
# POST /users/:id/keys
|
||||
post ":id/keys" do
|
||||
authenticated_as_admin!
|
||||
user = User.find(params[:id])
|
||||
attrs = attributes_for_keys [:title, :key]
|
||||
key = user.keys.new attrs
|
||||
if key.save
|
||||
present key, with: Entities::SSHKey
|
||||
else
|
||||
not_found!
|
||||
end
|
||||
end
|
||||
|
||||
# Delete user. Available only for admin
|
||||
#
|
||||
# Example Request:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue