forked from baron/baron-sso
개발자 권한을 페이지별로 선택/부여 가능하도록 개선
This commit is contained in:
@@ -2,6 +2,8 @@ package domain
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lib/pq"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -11,19 +13,39 @@ const (
|
||||
DeveloperRequestStatusCancelled = "cancelled"
|
||||
)
|
||||
|
||||
const (
|
||||
DeveloperAccessPageAll = "all"
|
||||
DeveloperAccessPageOverview = "overview"
|
||||
DeveloperAccessPageClientCreate = "client_create"
|
||||
DeveloperAccessPageAudit = "audit"
|
||||
)
|
||||
|
||||
var DeveloperAccessPageOrder = []string{
|
||||
DeveloperAccessPageOverview,
|
||||
DeveloperAccessPageClientCreate,
|
||||
DeveloperAccessPageAudit,
|
||||
}
|
||||
|
||||
// DeveloperRequest represents a user's application to become a developer.
|
||||
type DeveloperRequest struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
UserID string `gorm:"index;not null" json:"userId"` // Kratos User ID
|
||||
TenantID string `gorm:"index;not null" json:"tenantId"`
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
Organization string `json:"organization"`
|
||||
Email string `json:"email"`
|
||||
Phone string `json:"phone"`
|
||||
Role string `json:"role"`
|
||||
Reason string `json:"reason"`
|
||||
Status string `gorm:"default:'pending';not null" json:"status"` // pending, approved, rejected, cancelled
|
||||
AdminNotes string `json:"adminNotes"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
UserID string `gorm:"index;not null" json:"userId"` // Kratos User ID
|
||||
TenantID string `gorm:"index;not null" json:"tenantId"`
|
||||
Name string `gorm:"not null" json:"name"`
|
||||
Organization string `json:"organization"`
|
||||
Email string `json:"email"`
|
||||
Phone string `json:"phone"`
|
||||
Role string `json:"role"`
|
||||
Reason string `json:"reason"`
|
||||
AccessPages pq.StringArray `gorm:"type:text[]" json:"accessPages,omitempty"`
|
||||
Status string `gorm:"default:'pending';not null" json:"status"` // pending, approved, rejected, cancelled
|
||||
AdminNotes string `json:"adminNotes"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type DeveloperAccessStatus struct {
|
||||
Status string `json:"status"`
|
||||
ApprovedPages pq.StringArray `json:"approvedPages,omitempty"`
|
||||
PendingPages pq.StringArray `json:"pendingPages,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user