增加普通用户访问资产时的校验 close #44

This commit is contained in:
dushixiang
2021-01-26 21:54:44 +08:00
parent 4f1bfa6c5a
commit d771ad6ab6
7 changed files with 71 additions and 13 deletions

View File

@ -101,6 +101,10 @@ func UpdateUserById(o *User, id string) {
func DeleteUserById(id string) {
global.DB.Where("id = ?", id).Delete(&User{})
// 删除用户组中的用户关系
global.DB.Where("user_id = ?", id).Delete(&UserGroupMember{})
// 删除用户分享到的资产
global.DB.Where("user_id = ?", id).Delete(&ResourceSharer{})
}
func CountUser() (total int64, err error) {