Newer
Older
dmpopidor / app / controllers / api / v0 / guidance_groups_controller.rb
@Brian Riley Brian Riley on 7 Sep 2018 468 bytes Remove old JS form validations (#1867)
# frozen_string_literal: true

class Api::V0::GuidanceGroupsController < Api::V0::BaseController

  before_action :authenticate

  def index
    unless Api::V0::GuidanceGroupPolicy.new(@user, :guidance_group).index?
      raise Pundit::NotAuthorizedError
    end
    @all_viewable_groups = GuidanceGroup.all_viewable(@user)
    respond_with @all_viewable_groups
  end

  def pundit_user
    @user
  end


  private
  def query_params
    params.permit(:id)
  end

end