# app/policies/hoge/dashboard_policy.rb
class Hoge::DashboardPolicy < Struct.new(:user, :dashboard)
# ...
end
# In controllers
authorize [:hoge, :dashboard], :show?
# In views
<% if policy([:hoge, :dashboard]).show? %>
<%= link_to 'Dashboard', dashboard_path %>
<% end %>
- pundit gem