map id on select
This commit is contained in:
parent
1505a99044
commit
50fb96c200
|
@ -24,9 +24,9 @@ func getDomain(ctx context.Context, w http.ResponseWriter) (domain Domain, retur
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if login.Superadmin {
|
if login.Superadmin {
|
||||||
dbconnection.Where("id = ?", id).Find(&domain)
|
dbconnection.Where(map[string]int64{"ID": id}).Find(&domain)
|
||||||
} else {
|
} else {
|
||||||
dbconnection.Where(map[string]int64{"id": id, "profil": profil.ID}).Find(&domain)
|
dbconnection.Where(map[string]int64{"ID": id, "profil": profil.ID}).Find(&domain)
|
||||||
}
|
}
|
||||||
|
|
||||||
if domain.ID <= 0 {
|
if domain.ID <= 0 {
|
||||||
|
|
|
@ -24,7 +24,7 @@ func getMail(ctx context.Context, w http.ResponseWriter) (mail Mail, returnerr *
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if login.Superadmin {
|
if login.Superadmin {
|
||||||
dbconnection.Where("id = ?", id).Preload("Forwards").Find(&mail)
|
dbconnection.Where(map[string]int64{"ID": id}).Preload("Forwards").Find(&mail)
|
||||||
} else {
|
} else {
|
||||||
dbconnection.Where(map[string]int64{"ID": id, "domain.profil": profil.ID}).Preload("Forwards").Find(&mail)
|
dbconnection.Where(map[string]int64{"ID": id, "domain.profil": profil.ID}).Preload("Forwards").Find(&mail)
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ func getWeb(ctx context.Context, w http.ResponseWriter) (web Web, returnerr *lib
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if login.Superadmin {
|
if login.Superadmin {
|
||||||
dbconnection.Where("id = ?", id).Preload("HTTPAccess.Login").Preload("FTPAccess.Login").Find(&web)
|
dbconnection.Where(map[string]int64{"ID": id}).Preload("HTTPAccess.Login").Preload("FTPAccess.Login").Find(&web)
|
||||||
} else {
|
} else {
|
||||||
dbconnection.Where(map[string]int64{"ID": id, "domain.profil": profil.ID}).Preload("HTTPAccess.Login").Preload("FTPAccess.Login").Find(&web)
|
dbconnection.Where(map[string]int64{"ID": id, "domain.profil": profil.ID}).Preload("HTTPAccess.Login").Preload("FTPAccess.Login").Find(&web)
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue