module BeefCake
  class BasePolicy < ApplicationPolicy
    def index?
      admin?
    end

    def show?
      admin?
    end

    def new?
      admin?
    end

    def create?
      admin?
    end

    def edit?
      admin?
    end

    def update?
      admin?
    end

    def destroy?
      admin?
    end

    def markdown?
      admin?
    end

    def admin?
      user.admin?
    end

    def allowed?
      user.any_permission?
    end
  end
end
