app/controllers/application_controller.rb
# almost everything we do is restricted to a department so we always load_department
# feel free to skip_before_filter when desired
almost everything we do is restricted to a department so we always load_department
feel free to skip_before_filter when desired
almost everything we do is restricted to a department so we always load_department feel free to skip_before_filter when desired
def require_any_loc_group_admin
    unless current_user.is_loc_group_admin?(current_department)
      error_message = "That action is restricted to location group administrators."
      respond_to do |format|
        format.html do
          flash[:error] = error_message
          redirect_to access_denied_path
        end
        format.js do
          render :update do |page|
            ajax_alert(page, "<strong>error:</strong> "+error_message);
          end
          return false
        end
      end
    end
    return true
  end
def require_any_loc_group_admin unless current_user . is_loc_group_admin? ( current_department ) error_message = "That action is restricted to location group administrators." respond_to do | format | format . html do flash [ :error ] = error_message redirect_to access_denied_path end format . js do render :update do | page | ajax_alert ( page , "<strong>error:</strong> " + error_message ) ; end return false end end end return true end
almost everything we do is restricted to a department so we always load_department
feel free to skip_before_filter when desired
almost everything we do is restricted to a department so we always load_department feel free to skip_before_filter when desired
# display alert