varvet/pundit

Overriding both authorize and policy is required for namespacing

オープン

#723 opened on 2022/02/20

 (4 件のコメント) (1 件のリアクション) (0 人の担当者)Ruby (643 件のフォーク)batch import
good first issue

Repository metrics

Stars
 (8,501 個のスター)
PR merge metrics
 (30d に merged 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.

コントリビューターガイド