ReturnRequestPolicy's docblock contradicts its own code on orphan visibility
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 74/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- php
- Domain
- authorization
Research direction
Start with the ReturnRequestPolicy docblock and compare its orphan-visibility statement with view(), ownsIt(), and the existing tests. Update the documentation to match the behavior those tests already assert: orphan returns are invisible and not writable; do not change the policy code.
Written by the indexing model from the issue text.
Description
ReturnRequestPolicy's docblock says an orphan return — one whose team_id is null — is "visible, so an orphan can be found and fixed, and not writable".
The code does not do that. view() calls ownsIt(), which is false when team_id is null, so an orphan is visible to nobody.
Code and tests agree with each other; only the docblock is out of step. Found while writing the Filament package's docs, where the docblock was the thing being documented from — a comment that describes an access decision that the code does not make is the kind of thing an adopter takes at face value.
Two ways out, and they are not equivalent:
- Fix the docblock. Orphans are invisible. That is a defensible position: a row with no team cannot be scoped, and showing it to whoever asks is cross-tenant by construction.
- Fix the code. Orphans become visible-but-not-writable, as written. That needs a deliberate answer to "visible to whom", because "anyone with the view ability" is every tenant.
(1) matches what the tests already assert, so it is the smaller change and the safer default. (2) is a real feature and should be argued for on its own terms if anyone wants it.
- Dominant language
- PHP
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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 liberusoftware/module-ecommerce-returns
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
All issues in liberusoftware/module-ecommerce-returns
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·