app/controllers/site_controller.rb
# check if a signed-in user is a FireCloud user and redirect if not
check if a signed-in user is a FireCloud user and redirect if not
check if a signed - in user is a FireCloud user and redirect if not
def check_firecloud_registration
    if user_signed_in?
      if current_user.registered_for_firecloud?
         if !current_user.added_to_unity_group?
           current_user.add_to_unity_user_group
         end
      else
        if user_fire_cloud_client(current_user).registered?
          current_user.add_to_unity_user_group
          current_user.update(registered_for_firecloud: true)
          true
        else
          redirect_to profile_path, notice: 'You must register before using Unity - please fill out the profile form and submit.' and return
        end
      end
    end
  end
def check_firecloud_registration if user_signed_in? if current_user . registered_for_firecloud? if ! current_user . added_to_unity_group? current_user . add_to_unity_user_group end else if user_fire_cloud_client ( current_user ) . registered? current_user . add_to_unity_user_group current_user . update ( registered_for_firecloud : true ) true else redirect_to profile_path , notice : 'You must register before using Unity - please fill out the profile form and submit.' and return end end end end
check if a signed-in user is a FireCloud user and redirect if not
check if a signed - in user is a FireCloud user and redirect if not
# make sure user is part of user group