mirror of
https://github.com/grafana/grafana.git
synced 2026-08-14 07:04:57 -05:00
feat(invite): worked on pending invitations list, revoke invite now works, #2353
This commit is contained in:
+22
-3
@@ -10,6 +10,15 @@ var (
|
||||
ErrTempUserNotFound = errors.New("User not found")
|
||||
)
|
||||
|
||||
type TempUserStatus string
|
||||
|
||||
const (
|
||||
TmpUserInvitePending TempUserStatus = "InvitePending"
|
||||
TmpUserCompleted TempUserStatus = "Completed"
|
||||
TmpUserEmailPending TempUserStatus = "EmailPending"
|
||||
TmpUserRevoked TempUserStatus = "Revoked"
|
||||
)
|
||||
|
||||
// TempUser holds data for org invites and unconfirmed sign ups
|
||||
type TempUser struct {
|
||||
Id int64
|
||||
@@ -18,12 +27,13 @@ type TempUser struct {
|
||||
Email string
|
||||
Name string
|
||||
Role RoleType
|
||||
IsInvite bool
|
||||
InvitedByUserId int64
|
||||
Status TempUserStatus
|
||||
|
||||
EmailSent bool
|
||||
EmailSentOn time.Time
|
||||
Code string
|
||||
RemoteAddr string
|
||||
|
||||
Created time.Time
|
||||
Updated time.Time
|
||||
@@ -36,16 +46,24 @@ type CreateTempUserCommand struct {
|
||||
Email string
|
||||
Name string
|
||||
OrgId int64
|
||||
IsInvite bool
|
||||
InvitedByUserId int64
|
||||
Status TempUserStatus
|
||||
Code string
|
||||
Role RoleType
|
||||
RemoteAddr string
|
||||
|
||||
Result *TempUser
|
||||
}
|
||||
|
||||
type UpdateTempUserStatusCommand struct {
|
||||
Id int64
|
||||
OrgId int64
|
||||
Status TempUserStatus
|
||||
}
|
||||
|
||||
type GetTempUsersForOrgQuery struct {
|
||||
OrgId int64
|
||||
OrgId int64
|
||||
Status TempUserStatus
|
||||
|
||||
Result []*TempUserDTO
|
||||
}
|
||||
@@ -56,6 +74,7 @@ type TempUserDTO struct {
|
||||
Email string `json:"email"`
|
||||
Role string `json:"role"`
|
||||
InvitedBy string `json:"invitedBy"`
|
||||
Code string `json:"code"`
|
||||
EmailSent bool `json:"emailSent"`
|
||||
EmailSentOn time.Time `json:"emailSentOn"`
|
||||
Created time.Time `json:"createdOn"`
|
||||
|
||||
Reference in New Issue
Block a user