mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Organization: You can now update the organization user role directly (without removing and readding the organization user). Closes #1899
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
var (
|
||||
ErrInvalidRoleType = errors.New("Invalid role type")
|
||||
ErrLastOrgAdmin = errors.New("Cannot remove last organization admin")
|
||||
ErrOrgUserNotFound = errors.New("Cannot find the organization user")
|
||||
)
|
||||
|
||||
type RoleType string
|
||||
@@ -24,6 +25,7 @@ func (r RoleType) IsValid() bool {
|
||||
}
|
||||
|
||||
type OrgUser struct {
|
||||
Id int64
|
||||
OrgId int64
|
||||
UserId int64
|
||||
Role RoleType
|
||||
@@ -47,6 +49,13 @@ type AddOrgUserCommand struct {
|
||||
UserId int64 `json:"-"`
|
||||
}
|
||||
|
||||
type UpdateOrgUserCommand struct {
|
||||
Role RoleType `json:"role" binding:"Required"`
|
||||
|
||||
OrgId int64 `json:"-"`
|
||||
UserId int64 `json:"-"`
|
||||
}
|
||||
|
||||
// ----------------------
|
||||
// QUERIES
|
||||
|
||||
|
||||
Reference in New Issue
Block a user