user to sign in on a new installation will be an admin.
refs #4383
auto_setup_new_users: true
+ auto_admin_first_user: true
+
test:
uuid_prefix: zzzzz
secret_token: <%= rand(2**512).to_s(36) %>
end
def check_auto_admin
- if User.where("uuid not like '%-000000000000000'").where(:is_admin => true).count == 0 and Rails.configuration.auto_admin_user
- if self.email == Rails.configuration.auto_admin_user
+ if not self.uuid.end_with?('anonymouspublic') and
+ User.where("uuid not like '%-000000000000000'").where(:is_admin => true).count == 0
+ if (Rails.configuration.auto_admin_user and self.email == Rails.configuration.auto_admin_user) or
+ Rails.configuration.auto_admin_first_user
self.is_admin = true
self.is_active = true
end
# should be an address associated with a Google account.
auto_admin_user: false
+ # If auto_admin_first_user is set to true, the first user to log in when no
+ # other admin users exist will automatically become an admin user.
+ auto_admin_first_user: false
+
## Set Time.zone default to the specified zone and make Active
## Record auto-convert to this zone. Run "rake -D time" for a list
## of tasks for finding time zone names. Default is UTC.