ifres,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{
ifres,err:=sess.Query("SELECT 1 from "+dialect.Quote("dashboard_acl")+" WHERE dashboard_id =? and (team_id=? or user_id=?)",cmd.DashboardId,cmd.TeamId,cmd.UserId);err!=nil{
if_,err:=sess.Cols("updated","permission").Where("dashboard_id =? and (user_group_id=? or user_id=?)",cmd.DashboardId,cmd.UserGroupId,cmd.UserId).Update(&entity);err!=nil{
if_,err:=sess.Cols("updated","permission").Where("dashboard_id =? and (team_id=? or user_id=?)",cmd.DashboardId,cmd.TeamId,cmd.UserId).Update(&entity);err!=nil{
mg.AddMigration("create user group member table",NewAddTableMigration(userGroupMemberV1))
mg.AddMigration("create team member table",NewAddTableMigration(teamMemberV1))
//------- indexes ------------------
//------- indexes ------------------
mg.AddMigration("add index user_group_member.org_id",NewAddIndexMigration(userGroupMemberV1,userGroupMemberV1.Indices[0]))
mg.AddMigration("add index team_member.org_id",NewAddIndexMigration(teamMemberV1,teamMemberV1.Indices[0]))
mg.AddMigration("add unique index user_group_member_org_id_user_group_id_user_id",NewAddIndexMigration(userGroupMemberV1,userGroupMemberV1.Indices[1]))
mg.AddMigration("add unique index team_member_org_id_team_id_user_id",NewAddIndexMigration(teamMemberV1,teamMemberV1.Indices[1]))
<!-- <td><select class="gf-form-input gf-size-auto" ng-model="permission.permissions" ng-options="p.value as p.text for p in ctrl.permissionTypeOptions" ng-change="ctrl.updatePermission(permission)"></select></td> -->
<!-- <td><select class="gf-form-input gf-size-auto" ng-model="permission.permissions" ng-options="p.value as p.text for p in ctrl.permissionTypeOptions" ng-change="ctrl.updatePermission(permission)"></select></td> -->