How would I provide pundit authorization for a dashboard controller which provides data from various models?
My DashboardsController looks like this:
class DashboardsController < ApplicationController
before_action :authenticate_user!
before_action :set_user
before_action :set_business
after_action :verify_authorized
def index
end
private
def set_user
@user = current_user
end
def set_business
@business = current_user.business
end
end
How would I authorize for both @user and @business within my DashboardsPolicy?