mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-06-04 04:23:00 +00:00
initiall commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package models
|
||||
|
||||
import "github.com/google/uuid"
|
||||
|
||||
type ActorType string
|
||||
|
||||
const (
|
||||
ActorTypeUser ActorType = "user"
|
||||
ActorTypeAPIKey ActorType = "api_key"
|
||||
)
|
||||
|
||||
type Actor struct {
|
||||
Type ActorType
|
||||
UserID *uuid.UUID
|
||||
AuthSubject string
|
||||
Email string
|
||||
EmailVerified bool
|
||||
Name string
|
||||
SessionID string
|
||||
ProjectID *uuid.UUID
|
||||
OrganizationID *uuid.UUID
|
||||
APIKeyID *uuid.UUID
|
||||
APIKeyPrefix string
|
||||
}
|
||||
|
||||
func (a *Actor) IsUser() bool {
|
||||
return a != nil && a.Type == ActorTypeUser
|
||||
}
|
||||
|
||||
func (a *Actor) IsAPIKey() bool {
|
||||
return a != nil && a.Type == ActorTypeAPIKey
|
||||
}
|
||||
Reference in New Issue
Block a user