varvet/pundit

Overriding both authorize and policy is required for namespacing

开放

#723 创建于 2022年2月20日

 (4 条评论) (1 个反应) (0 位负责人)Ruby (643 个派生)batch import
good first issue

仓库指标

星标
 (8,501 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

The README explains how to namespace policies, however this does not seem to take into account direct calls to policy (e.g. calling policy(record).show? from some view). Before the merge of #697, it was possible to only override policy and authorize would automatically be properly scoped as well. Now it has apparently become necessary to override both authorize and policy in Pundit::Authorization. It still works, but is just now more cumbersome, and also required some figuring out when performing the upgrade to Pundit 2.2.0.

Opening this issue as suggested in #697.

贡献者指南