WIP: fix acl route

This commit is contained in:
Daniel Lee
2017-06-20 00:34:25 +02:00
parent aaf2a897b0
commit 812112f2f6
3 changed files with 7 additions and 2 deletions
+4
View File
@@ -20,6 +20,10 @@ func SetDashboardAcl(cmd *m.SetDashboardAclCommand) error {
return m.ErrDashboardPermissionUserOrUserGroupEmpty
}
if cmd.DashboardId == 0 {
return m.ErrDashboardPermissionDashboardEmpty
}
if res, err := sess.Query("SELECT 1 from "+dialect.Quote("dashboard_acl")+" WHERE dashboard_id =? and (user_group_id=? or user_id=?)", cmd.DashboardId, cmd.UserGroupId, cmd.UserId); err != nil {
return err
} else if len(res) == 1 {