diff --git a/app/lib/email_validator.rb b/app/lib/email_validator.rb
index c11f9db..ae20c96 100644
--- a/app/lib/email_validator.rb
+++ b/app/lib/email_validator.rb
@@ -1,14 +1,18 @@
module EmailValidator
+
+ # which allowed domains can sign in to the request an account service
def self.email_is_allowed?(email)
return true if email.end_with? '@digital.cabinet-office.gov.uk'
return true if email.end_with? '@cabinetoffice.gov.uk'
false
end
+ # which domains are allowed to be requested for a gds-users account
def self.allowed_emails_regexp
Regexp.union(
- /\A([a-z.\-]+@digital\.cabinet-office\.gov\.uk,?\s*)+\z/,
- /\A([a-z.\-]+@cabinetoffice\.gov\.uk,?\s*)+\z/,
+ /\A([a-z.\-\']+@digital\.cabinet-office\.gov\.uk,?\s*)+\z/,
+ /\A([a-z.\-\']+@cabinetoffice\.gov\.uk,?\s*)+\z/,
+ /\A([a-z.\-\']+@softwire\.com,?\s*)+\z/,
)
end
diff --git a/app/models/administrators_form.rb b/app/models/administrators_form.rb
index f1b8ddc..484b2ed 100644
--- a/app/models/administrators_form.rb
+++ b/app/models/administrators_form.rb
@@ -4,7 +4,7 @@ class AdministratorsForm
attr_reader :admin_users
validates_format_of :admin_users,
with: EmailValidator.allowed_emails_regexp,
- message: 'should be a list of GDS emails'
+ message: 'should be a list of approved emails'
validates_each :admin_users do |record, attr, value|
record.errors.add attr, 'is required' if value.nil? || value.empty?
end
diff --git a/app/models/user_form.rb b/app/models/user_form.rb
index 8009029..611e08e 100644
--- a/app/models/user_form.rb
+++ b/app/models/user_form.rb
@@ -4,7 +4,7 @@ class UserForm
attr_reader :email_list
validates_format_of :email_list,
with: EmailValidator.allowed_emails_regexp,
- message: 'should be a list of GDS emails'
+ message: 'should be a list of approved emails'
validates_each :email_list do |record, attr, value|
record.errors.add attr, 'is required' if value.nil? || value == ''
end
diff --git a/app/views/administrators/administrators.html.erb b/app/views/administrators/administrators.html.erb
index 0c90512..3fef1b8 100644
--- a/app/views/administrators/administrators.html.erb
+++ b/app/views/administrators/administrators.html.erb
@@ -9,7 +9,7 @@