app/controllers/application_controller.rb
# These are the authorization before_filters to use under controllers
# These all return nil
These are the authorization before_filters to use under controllers
These all return nil
These are the authorization before_filters to use under controllers These all return nil
def require_department_admin
    unless current_user.is_admin_of?(current_department)
      error_message = "That action is restricted to department administrators."
      flash[:error] = error_message
      respond_to do |format|
        format.html do
          redirect_to access_denied_path
        end
        format.js do
          @ajax_error_message = "<strong>Error:</strong>" + error_message
          render :update 
          return false
        end
      end
    end
    return true
  end
def require_department_admin unless current_user . is_admin_of? ( current_department ) error_message = "That action is restricted to department administrators." flash [ :error ] = error_message respond_to do | format | format . html do redirect_to access_denied_path end format . js do @ajax_error_message = "<strong>Error:</strong>" + error_message render :update return false end end end return true end
These are the authorization before_filters to use under controllers
These all return nil
These are the authorization before_filters to use under controllers These all return nil