ash-project / ash-project/ash

Compiler doesn't warn when using Ash.Policy.Authorizer in wrong place.

Open
#716 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Elixir
Stars
2.5k
Forks
422
Avg merge
23h 26m
Merged PRs (30d)
46

Description

Sometimes when sleep deprived / not paying attention you may add `Ash.Policy.Authorizer` to the `extensions` list on your resource declaration (instead of in the `authorizers` list), you will then proceed to be flummoxed for the next few hours as your policies don't work - yet your resource has the policy DSL available in it.

Ideally this would throw an error.

Contributor guide

Open the contributing guide

Research direction

Start at the resource declaration handling for the `extensions` and `authorizers` lists, focusing on how `Ash.Policy.Authorizer` is recognized. Reproduce the misplaced extension configuration and trace the compiler validation path; done means it reports an error when `Ash.Policy.Authorizer` is placed in `extensions` instead of `authorizers`.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.