lib/cas/setup.rb in cas-cms-0.1.0 vs lib/cas/setup.rb in cas-cms-0.1.1

- old
+ new

@@ -24,9 +24,26 @@ name: section["name"], section_type: section["type"], ) end end + + if superadmins_emails_or_logins = config["config"]["superadmins"] + updated_users = [] + superadmins_emails_or_logins.each do |email_or_login| + user = ::Cas::User.where( + 'cas_users.email = :value OR cas_users.login = :value', + value: email_or_login + ).first + + if user.present? + unless updated_users.include?(user.id) + user.update!(sites: ::Cas::Site.all) + end + updated_users << user.id + end + end + end end end private