SCIM: Add a distinctive label for externally provisioned users (#102701)
* Add json mapping for user.isProvisioned * Retrieve the isProvisioned value from database * Add a Provisioned label to pages that list users * Update swagger definitions * Add changes to User Admin pages
This commit is contained in:
@@ -157,6 +157,7 @@ type OrgUserDTO struct {
|
||||
IsDisabled bool `json:"isDisabled"`
|
||||
AuthLabels []string `json:"authLabels" xorm:"-"`
|
||||
IsExternallySynced bool `json:"isExternallySynced"`
|
||||
IsProvisioned bool `json:"isProvisioned"`
|
||||
}
|
||||
|
||||
type RemoveOrgUserCommand struct {
|
||||
|
||||
@@ -611,6 +611,7 @@ func (ss *sqlStore) SearchOrgUsers(ctx context.Context, query *org.SearchOrgUser
|
||||
"u.created",
|
||||
"u.updated",
|
||||
"u.is_disabled",
|
||||
"u.is_provisioned",
|
||||
)
|
||||
|
||||
if len(query.SortOpts) > 0 {
|
||||
|
||||
@@ -137,11 +137,11 @@ type UserSearchHitDTO struct {
|
||||
AvatarURL string `json:"avatarUrl" xorm:"avatar_url"`
|
||||
IsAdmin bool `json:"isAdmin"`
|
||||
IsDisabled bool `json:"isDisabled"`
|
||||
IsProvisioned bool `json:"isProvisioned"`
|
||||
LastSeenAt time.Time `json:"lastSeenAt"`
|
||||
LastSeenAtAge string `json:"lastSeenAtAge"`
|
||||
AuthLabels []string `json:"authLabels"`
|
||||
AuthModule AuthModuleConversion `json:"-"`
|
||||
IsProvisioned bool `json:"-" xorm:"is_provisioned"`
|
||||
}
|
||||
|
||||
type GetUserProfileQuery struct {
|
||||
@@ -166,7 +166,7 @@ type UserProfileDTO struct {
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
AvatarURL string `json:"avatarUrl"`
|
||||
AccessControl map[string]bool `json:"accessControl,omitempty"`
|
||||
IsProvisioned bool `json:"-"`
|
||||
IsProvisioned bool `json:"isProvisioned"`
|
||||
}
|
||||
|
||||
// implement Conversion interface to define custom field mapping (xorm feature)
|
||||
|
||||
@@ -374,6 +374,7 @@ func (ss *sqlStore) GetProfile(ctx context.Context, query *user.GetUserProfileQu
|
||||
Theme: usr.Theme,
|
||||
IsGrafanaAdmin: usr.IsAdmin,
|
||||
IsDisabled: usr.IsDisabled,
|
||||
IsProvisioned: usr.IsProvisioned,
|
||||
OrgID: usr.OrgID,
|
||||
UpdatedAt: usr.Updated,
|
||||
CreatedAt: usr.Created,
|
||||
@@ -526,7 +527,7 @@ func (ss *sqlStore) Search(ctx context.Context, query *user.SearchUsersQuery) (*
|
||||
sess.Limit(query.Limit, offset)
|
||||
}
|
||||
|
||||
sess.Cols("u.id", "u.uid", "u.email", "u.name", "u.login", "u.is_admin", "u.is_disabled", "u.last_seen_at", "user_auth.auth_module")
|
||||
sess.Cols("u.id", "u.uid", "u.email", "u.name", "u.login", "u.is_admin", "u.is_disabled", "u.last_seen_at", "user_auth.auth_module", "u.is_provisioned")
|
||||
|
||||
if len(query.SortOpts) > 0 {
|
||||
for i := range query.SortOpts {
|
||||
|
||||
Reference in New Issue
Block a user