fix mass-assignment error in user create API

This commit is contained in:
Nihad Abbasov 2012-10-19 03:23:10 -07:00
parent 770ec3359d
commit c610206321
2 changed files with 6 additions and 6 deletions

View file

@ -23,7 +23,7 @@ module Gitlab
@user = User.find(params[:id])
present @user, with: Entities::User
end
# Create user. Available only for admin
#
# Parameters:
@ -40,7 +40,7 @@ module Gitlab
post do
authenticated_as_admin!
attrs = attributes_for_keys [:email, :name, :password, :password_confirmation, :skype, :linkedin, :twitter, :projects_limit]
user = User.new attrs
user = User.new attrs, as: :admin
if user.save
present user, with: Entities::User
else