diff options
author | Drew Blessing <drew@gitlab.com> | 2015-12-11 14:33:15 -0600 |
---|---|---|
committer | Drew Blessing <drew@gitlab.com> | 2015-12-15 13:54:35 -0600 |
commit | 577448ab6ab35abbf0263bf8677dfde6d9770c3f (patch) | |
tree | 6355effd4303933bd374463d467dbc18181e92ca /app/controllers/admin | |
parent | 2b4a3bc524c0db3f6e4e3d2b2f34ec29e358b240 (diff) | |
download | gitlab-ce-577448ab6ab35abbf0263bf8677dfde6d9770c3f.tar.gz |
Allow admin to create new user identities
Diffstat (limited to 'app/controllers/admin')
-rw-r--r-- | app/controllers/admin/identities_controller.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/app/controllers/admin/identities_controller.rb b/app/controllers/admin/identities_controller.rb index d28614731f9..e383fe38ea6 100644 --- a/app/controllers/admin/identities_controller.rb +++ b/app/controllers/admin/identities_controller.rb @@ -1,6 +1,21 @@ class Admin::IdentitiesController < Admin::ApplicationController before_action :user - before_action :identity, except: :index + before_action :identity, except: [:index, :new, :create] + + def new + @identity = Identity.new + end + + def create + @identity = Identity.new(identity_params) + @identity.user_id = user.id + + if @identity.save + redirect_to admin_user_identities_path(@user), notice: 'User identity was successfully created.' + else + render :new + end + end def index @identities = @user.identities |