Worked on user administration page, a grafana server admin can now add and edit organization roles for any user, #2014

This commit is contained in:
Torkel Ödegaard
2015-05-19 11:47:14 +02:00
parent 788e7fd36d
commit a8aab0cb2b
12 changed files with 169 additions and 47 deletions
+3
View File
@@ -84,6 +84,9 @@ func updateOrgUserHelper(cmd m.UpdateOrgUserCommand) Response {
}
if err := bus.Dispatch(&cmd); err != nil {
if err == m.ErrLastOrgAdmin {
return ApiError(400, "Cannot change role so that there is no organization admin left", nil)
}
return ApiError(500, "Failed update org user", err)
}