folders: changed api urls for dashboard acls

This commit is contained in:
Torkel Ödegaard
2017-06-19 18:11:30 -04:00
parent c4a1803060
commit aaf2a897b0
6 changed files with 37 additions and 61 deletions
+2 -2
View File
@@ -76,8 +76,8 @@ func SetDashboardAcl(cmd *m.SetDashboardAclCommand) error {
func RemoveDashboardAcl(cmd *m.RemoveDashboardAclCommand) error {
return inTransaction(func(sess *DBSession) error {
var rawSQL = "DELETE FROM " + dialect.Quote("dashboard_acl") + " WHERE dashboard_id =? and (user_group_id=? or user_id=?)"
_, err := sess.Exec(rawSQL, cmd.DashboardId, cmd.UserGroupId, cmd.UserId)
var rawSQL = "DELETE FROM " + dialect.Quote("dashboard_acl") + " WHERE org_id =? and id=?"
_, err := sess.Exec(rawSQL, cmd.OrgId, cmd.AclId)
if err != nil {
return err
}
+4 -6
View File
@@ -114,9 +114,8 @@ func TestDashboardAclDataAccess(t *testing.T) {
Convey("Should be able to delete an existing permission", func() {
err := RemoveDashboardAcl(&m.RemoveDashboardAclCommand{
OrgId: 1,
UserId: 1,
DashboardId: savedFolder.Id,
OrgId: 1,
AclId: 1,
})
So(err, ShouldBeNil)
@@ -170,9 +169,8 @@ func TestDashboardAclDataAccess(t *testing.T) {
Convey("Should be able to delete an existing permission for a user group", func() {
err := RemoveDashboardAcl(&m.RemoveDashboardAclCommand{
OrgId: 1,
UserGroupId: group1.Result.Id,
DashboardId: savedFolder.Id,
OrgId: 1,
AclId: 1,
})
So(err, ShouldBeNil)