class ApplicationController < Sinatra::Base # Include Pundit for authorization include Pundit helpers do def authorized?(policy, permission) return false unless authenticated? policy(policy).send permission end end end