I have a Project policy that only super or admin can have access to.
It looks like this now:
class ProjectPolicy < ApplicationPolicy
def index?
super_or_admin?
end
def new?
super_or_admin?
end
def create?
super_or_admin?
end
def update?
super_or_admin?
end
def show?
super_or_admin?
end
def super_or_admin?
user.role.name == 'superadmin' or user.role.name == 'admin'
end
end
Is it possible to have pundit automatically apply super_or_admin?
to all the routes instead of defining each of them manually?