1
0
Fork 0
This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/policies/application_policy.rb

73 lines
874 B
Ruby

# frozen_string_literal: true
class ApplicationPolicy
attr_reader :context, :record
def initialize(context, record)
@context = context
@record = record
end
# :nocov:
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
# :nocov:
def policy(record)
Pundit.policy context, record
end
class Scope
attr_reader :context, :scope
def initialize(context, scope)
@context = context
@scope = scope
end
# :nocov:
def resolve
scope.none
end
# :nocov:
end
class Context
attr_reader :account, :guest_account
def initialize(account:, guest_account:)
@account = account
@guest_account = guest_account
end
end
end