WIP: add permission check for GetDashboard

This commit is contained in:
Daniel Lee
2017-06-12 15:48:55 +02:00
parent ef0facc987
commit 3913f16550
7 changed files with 275 additions and 21 deletions

View File

@ -23,6 +23,11 @@ func TestDashboardAclApiEndpoint(t *testing.T) {
return nil
})
bus.AddHandler("test", func(query *models.GetUserGroupsByUserQuery) error {
query.Result = []*models.UserGroup{}
return nil
})
Convey("When user is org admin", func() {
loggedInUserScenarioWithRole("When calling GET on", "GET", "/api/dashboards/1/acl", "/api/dashboards/:id/acl", models.ROLE_ADMIN, func(sc *scenarioContext) {
Convey("Should be able to access ACL", func() {