Sha256: 7daaeff821444e9748c77d51a5bf3e2270fe1e961515034315a9e52e41767b12

Contents?: true

Size: 520 Bytes

Versions: 24

Compression:

Stored size: 520 Bytes

Contents

class ApplicationPolicy
	attr_reader :user, :record

	def initialize(user, record)
		@user = user
		@record = record
	end

	def index?
		false
	end

	def show?
		false
	end

	def create?
		false
	end

	def new?
		create?
	end

	def update?
		false
	end

	def edit?
		update?
	end

	def destroy?
		false
	end

	def scope
		Pundit.policy_scope!(user, record.class)
	end

	class Scope
		attr_reader :user, :scope

		def initialize(user, scope)
			@user = user
			@scope = scope
		end

		def resolve
			scope
		end
	end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
proclaim-0.1.3 app/policies/application_policy.rb
proclaim-0.1.2 app/policies/application_policy.rb
proclaim-0.1.1 app/policies/application_policy.rb
proclaim-0.1.0 app/policies/application_policy.rb