Add per-user item ownership and isolation
Items are now private to their owner. Add items.user_id (migrated in place, existing items backfilled to the first admin) and scope every item, results, and dashboard view to the signed-in user via owner-scoped queries plus an ownedItem 404 guard. Admins get strict isolation too; elevation stays limited to settings and user management. Alert routing follows ownership: deal emails go only to the item owner and the weekly digest is built per-recipient from their own items. The scheduler still polls every active item; the Apify/eBay budget stays a shared pool visible to all. Add TestItemsArePrivatePerUser and seed owners in db tests.
This commit is contained in:
@@ -30,6 +30,7 @@ type User struct {
|
||||
|
||||
type Item struct {
|
||||
ID int64
|
||||
UserID int64
|
||||
Name string
|
||||
SearchQuery string
|
||||
URL string
|
||||
|
||||
Reference in New Issue
Block a user