Feat admin rbac migration (#1)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -23,12 +23,9 @@ const (
|
||||
ScopePersonal = "personal"
|
||||
)
|
||||
|
||||
// ── Role Constants ──────────────────────────
|
||||
// ── Team Role Constants ─────────────────────
|
||||
|
||||
const (
|
||||
UserRoleUser = "user"
|
||||
UserRoleAdmin = "admin"
|
||||
|
||||
TeamRoleAdmin = "admin"
|
||||
TeamRoleMember = "member"
|
||||
)
|
||||
@@ -48,7 +45,6 @@ type User struct {
|
||||
PasswordHash string `json:"-" db:"password_hash"`
|
||||
DisplayName string `json:"display_name,omitempty" db:"display_name"`
|
||||
AvatarURL string `json:"avatar_url,omitempty" db:"avatar_url"`
|
||||
Role string `json:"role" db:"role"`
|
||||
IsActive bool `json:"is_active" db:"is_active"`
|
||||
Settings JSONMap `json:"settings,omitempty" db:"settings"`
|
||||
LastLoginAt *time.Time `json:"last_login_at,omitempty" db:"last_login_at"`
|
||||
@@ -316,24 +312,15 @@ type Group struct {
|
||||
TeamID *string `json:"team_id,omitempty" db:"team_id"`
|
||||
CreatedBy *string `json:"created_by,omitempty" db:"created_by"`
|
||||
Source string `json:"source" db:"source"` // manual (default), oidc, system
|
||||
Permissions []string `json:"permissions" db:"permissions"`
|
||||
TokenBudgetDaily *int64 `json:"token_budget_daily,omitempty" db:"token_budget_daily"`
|
||||
TokenBudgetMonthly *int64 `json:"token_budget_monthly,omitempty" db:"token_budget_monthly"`
|
||||
AllowedModels []string `json:"allowed_models,omitempty" db:"allowed_models"` // nil = unrestricted
|
||||
MemberCount int `json:"member_count,omitempty"` // computed, not a DB column
|
||||
Permissions []string `json:"permissions" db:"permissions"`
|
||||
MemberCount int `json:"member_count,omitempty"` // computed, not a DB column
|
||||
}
|
||||
|
||||
// GroupPatch holds optional fields for updating a group.
|
||||
type GroupPatch struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Permissions *[]string `json:"permissions,omitempty"`
|
||||
TokenBudgetDaily *int64 `json:"token_budget_daily,omitempty"`
|
||||
TokenBudgetMonthly *int64 `json:"token_budget_monthly,omitempty"`
|
||||
AllowedModels *[]string `json:"allowed_models,omitempty"` // &[]string{} = restrict to none; nil = no change
|
||||
ClearBudgetDaily bool `json:"clear_budget_daily,omitempty"`
|
||||
ClearBudgetMonthly bool `json:"clear_budget_monthly,omitempty"`
|
||||
ClearAllowedModels bool `json:"clear_allowed_models,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Permissions *[]string `json:"permissions,omitempty"`
|
||||
}
|
||||
|
||||
// GroupMember links a user to a group.
|
||||
|
||||
Reference in New Issue
Block a user