aboutsummaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-03-26 22:11:04 +0100
committerChristopher Baines <mail@cbaines.net>2018-04-03 21:57:39 +0100
commit4e34ede0d390d5158188d20b1dbf6d87b6c60b9f (patch)
tree1303b5d3552775253b4808c4b930e51761526218 /app/controllers
parent9649f88d2857e686c59867031aaad228cc4358fa (diff)
downloadgovuk-mini-environment-admin-4e34ede0d390d5158188d20b1dbf6d87b6c60b9f.tar
govuk-mini-environment-admin-4e34ede0d390d5158188d20b1dbf6d87b6c60b9f.tar.gz
Add support for specifying Signon users
When creating mini environments.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/mini_environments_controller.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/controllers/mini_environments_controller.rb b/app/controllers/mini_environments_controller.rb
index 5c7f6f6..82baeab 100644
--- a/app/controllers/mini_environments_controller.rb
+++ b/app/controllers/mini_environments_controller.rb
@@ -5,6 +5,13 @@ class MiniEnvironmentsController < ApplicationController
def new
@mini_environment = MiniEnvironment.new
+
+ @mini_environment.signon_users = [
+ {
+ name: current_user.name,
+ email: current_user.email
+ }
+ ]
end
def create
@@ -12,7 +19,12 @@ class MiniEnvironmentsController < ApplicationController
:mini_environment
).permit(
:name,
- :govuk_guix_revision_id
+ :govuk_guix_revision_id,
+ signon_users_attributes: [
+ :name,
+ :email,
+ :role
+ ]
)
@mini_environment = MiniEnvironment.new(parameters)