Currently unable to move forward because I'm running into an issue where Pundit is reporting that authorization hasn't been run, but I believe all the steps are in (relevant sections below). After dumping them all out, all I can think of is possibly that context is conflicting with whatever pundit-resources is setting? Any help is appreciated.
class ApplicationPolicy
attr_reader :user, :record
def initialize(user, record)
Rails.logger.info "Policy User:"
Rails.logger.ap user
@user = user
@record = record
end
def index?
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
class UserPolicy < ApplicationPolicy
def create?
user.admin?
end
def update?
user.admin?
end
def destroy?
user.admin?
end
end
Currently unable to move forward because I'm running into an issue where Pundit is reporting that authorization hasn't been run, but I believe all the steps are in (relevant sections below). After dumping them all out, all I can think of is possibly that
context
is conflicting with whatever pundit-resources is setting? Any help is appreciated.