From c61020632147e0855cf229bce81aa080ca1e5992 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Fri, 19 Oct 2012 03:23:10 -0700 Subject: fix mass-assignment error in user create API --- lib/api/users.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/api/users.rb') diff --git a/lib/api/users.rb b/lib/api/users.rb index 7f548aaa667..108a3f123db 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -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 -- cgit v1.2.1