Commit 009d6f7
committed
fix(RowService): allow public share row operations without breaking async import guard
ef3db38 tightened the userId guard in RowService::create() and ::updateSet()
from `=== null` to `=== null || === ''` to prevent async import background jobs
from silently creating rows without a real user in context.
However, the codebase intentionally uses an empty string as the public-context
sentinel: PublicRowOCSController calls setPublicContext(), which sets
$this->userId = '' in SuperService and $isPublicContext = true in
PermissionsService. PermissionsService::basisCheck() explicitly handles
$userId === '' by returning true when isPublicContext is set. The tightened
guard in ef3db38 rejected '' before it ever reached the permissions layer,
breaking row create and update for all public link shares.
The fix tracks the public context flag in SuperService itself via a new
$isPublicContext property, set alongside $this->userId = '' in
setPublicContext(). The guard in RowService is updated to:
null → always throws (DI never injected a user)
'' + !publicCtx → throws (background job running without a user — the
case ef3db38 was protecting against)
'' + publicCtx → passes (setPublicContext() was called intentionally)
'alice' → always passes (normal authenticated user)
Async imports remain protected because ImportTableJob never calls
setPublicContext(), so $isPublicContext stays false for that code path.
AI-assistant: Claude Code v2.1.143 (Claude Sonnet 4.6)
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>1 parent 025dcc2 commit 009d6f7
2 files changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
27 | 30 | | |
28 | 31 | | |
29 | 32 | | |
0 commit comments