25 lines
1.0 KiB
Go
25 lines
1.0 KiB
Go
package entity
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"time"
|
|
)
|
|
|
|
// UserLevelMenuAccesses mengatur akses user_level ke menu tertentu
|
|
// Contoh: UserLevel "Admin Pusat" bisa akses semua menu, "Editor" hanya bisa akses "Content Management"
|
|
type UserLevelMenuAccesses struct {
|
|
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
|
UserLevelId uint `json:"user_level_id" gorm:"type:int4;not null"`
|
|
MenuId uint `json:"menu_id" gorm:"type:int4;not null"`
|
|
CanAccess bool `json:"can_access" gorm:"type:bool;default:true"` // Apakah boleh akses menu ini
|
|
ClientId *uuid.UUID `json:"client_id" gorm:"type:UUID"`
|
|
IsActive *bool `json:"is_active" gorm:"type:bool;default:true"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
|
|
|
// Relations
|
|
UserLevel *UserLevels `json:"user_level,omitempty" gorm:"foreignKey:UserLevelId"`
|
|
Menu *MasterMenus `json:"menu,omitempty" gorm:"foreignKey:MenuId"`
|
|
}
|
|
|