From 6166228f4493ce41738921caaa403911b979f1a3 Mon Sep 17 00:00:00 2001 From: wisplite Date: Wed, 19 Nov 2025 20:31:08 -0600 Subject: [PATCH] user access model --- backend/internal/models/album.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/internal/models/album.go b/backend/internal/models/album.go index 714f8be..58f056a 100644 --- a/backend/internal/models/album.go +++ b/backend/internal/models/album.go @@ -12,6 +12,16 @@ type Album struct { Description string `gorm:"not null"` Tags datatypes.JSON `gorm:"type:json"` Private bool `gorm:"not null"` + // Public albums have a default access level of 0 for all visitors, including guests. + // Private albums require a user with access to be logged in to view, or a magic link to be used. + CreatedAt time.Time + UpdatedAt time.Time +} + +type UserAccess struct { + UserID string `gorm:"not null"` + AlbumID string `gorm:"not null"` + AccessLevel int `gorm:"not null"` // 0: View, 1: Upload, 2: Edit, 3: Edit/Delete, 4: Admin (manage other users) CreatedAt time.Time UpdatedAt time.Time }