【发布时间】:2018-03-15 23:31:06
【问题描述】:
如何为提供来自各种模型的数据的仪表板控制器提供权威人士授权?
我的 DashboardsController 如下所示:
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
如何在我的 DashboardsPolicy 中同时授权 @user 和 @business?
【问题讨论】:
标签: ruby-on-rails ruby pundit