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
+8 -1
View File
@@ -142,11 +142,18 @@ func TestAccountDataAccess(t *testing.T) {
})
})
Convey("Cannot delete last admin account user", func() {
Convey("Cannot delete last admin org user", func() {
cmd := m.RemoveOrgUserCommand{OrgId: ac1.OrgId, UserId: ac1.Id}
err := RemoveOrgUser(&cmd)
So(err, ShouldEqual, m.ErrLastOrgAdmin)
})
Convey("Cannot update role so no one is admin user", func() {
cmd := m.UpdateOrgUserCommand{OrgId: ac1.OrgId, UserId: ac1.Id, Role: m.ROLE_VIEWER}
err := UpdateOrgUser(&cmd)
So(err, ShouldEqual, m.ErrLastOrgAdmin)
})
})
})
})