Sha256: 68b198646fda244b3ad7c5cc32b7cd5e64a917c36f76dae58b9c29c3c0638622
Contents?: true
Size: 755 Bytes
Versions: 90
Compression:
Stored size: 755 Bytes
Contents
# frozen_string_literal: true # Pundit ApplicationPolicy class ApplicationPolicy attr_reader :user, :record def initialize(user, record) raise Pundit::NotAuthorizedError, 'must be logged in' unless user @user = user @record = record end def index? false end def show? false end def create? false end def new? false end def update? false end def edit? false end def destroy? false end # Pundit ApplicationPolicy - Scope class Scope attr_reader :user, :scope def initialize(user, scope) raise Pundit::NotAuthorizedError, 'must be logged in' unless user @user = user @scope = scope end def resolve scope.all end end end
Version data entries
90 entries across 90 versions & 1 rubygems