Move Organization affiliation-date lock off Current.user
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- ruby
- Domain
- authorization, backend
Research direction
Read CLAUDE.md’s “Authorization lives in policies” rule, then trace Organization#affiliation_dates_locked and the controller and admin service callers that save organizations. Inventory callers that currently rely on Current.user to bypass the lock, including dedupe merges; determine how each would supply the proposed flag. Done means the callers are accounted for so moving the permission decision into a policy does not break their saves.
Written by the indexing model from the issue text.
Description
🤖 From Claude: Organization#affiliation_dates_locked is skipped for admins by reading Current.user&.super_user? inside the model. Models shouldn't make permission decisions (see the "Authorization lives in policies" rule in CLAUDE.md, added in #2831).
Proposed fix
- The controller asks a policy rule (e.g.
OrganizationPolicy#edit_affiliation_dates?). - It hands the model a flag, the way story ideas set
organization_required.
Why blocked
- Admin-run services that save organizations (e.g. dedupe merges) currently bypass the lock through
Current.user. - With a flag, each of those callers has to set it, or its saves start failing validation.
- They need to be inventoried first.
- Dominant language
- Ruby
- Stars
- 15
- Forks
- 28
- Avg merge
- 14h 29m
- Merged PRs (30d)
- 292
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rubyforgood/awbw
-
blocked
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
rubyforgood/awbw#2824 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
rubyforgood/awbw#2822 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rubyforgood/awbw#2160 ·
Maintainers usually reply within 1 day
-
Update callout faq defualt text when the new person subscription launchesPossibly taken @maebeale claimed this 98 days ago. Openblocked
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rubyforgood/awbw#2095 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
rubyforgood/awbw#2088 ·
Maintainers usually reply within 1 day
All issues in rubyforgood/awbw
Similar issues
-
Bug Ruby
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-ruby#3211 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
internetee/registry#2984 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ecosyste-ms/issues#862 ·
Maintainers usually reply within 1 day
-
Redis Lua error `@user_script:52: ERR value is not an integer or out of range` when `window_size` is configuredPossibly taken @mimosa claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
riscv/riscv-unified-db#2829 ·
Maintainers usually reply within 1 day