42 lines
1.2 KiB
Go
42 lines
1.2 KiB
Go
package model
|
|
|
|
import (
|
|
"database/sql"
|
|
"time"
|
|
)
|
|
|
|
const COOKIE_TOKEN string = "AM_SESSION"
|
|
|
|
type (
|
|
Account struct {
|
|
ID string `json:"id" db:"id"`
|
|
Username string `json:"username" db:"username"`
|
|
Password string `json:"password" db:"password"`
|
|
Email sql.NullString `json:"email" db:"email"`
|
|
AvatarURL sql.NullString `json:"avatar_url" db:"avatar_url"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
|
|
Privileges []AccountPrivilege `json:"privileges"`
|
|
}
|
|
|
|
AccountPrivilege string
|
|
)
|
|
|
|
const (
|
|
Root AccountPrivilege = "root" // grants all permissions. very dangerous to grant!
|
|
|
|
// unused for now
|
|
CreateInvites AccountPrivilege = "create_invites"
|
|
ReadAccounts AccountPrivilege = "read_accounts"
|
|
EditAccounts AccountPrivilege = "edit_accounts"
|
|
|
|
ReadReleases AccountPrivilege = "read_releases"
|
|
EditReleases AccountPrivilege = "edit_releases"
|
|
|
|
ReadTracks AccountPrivilege = "read_tracks"
|
|
EditTracks AccountPrivilege = "edit_tracks"
|
|
|
|
ReadArtists AccountPrivilege = "read_artists"
|
|
EditArtists AccountPrivilege = "edit_artists"
|
|
)
|