...
|
...
|
@@ -383,6 +383,7 @@ func (service UsersService) buildGetUserData(userData *domain.Users, partnerList |
|
|
"isAdmin": 0,
|
|
|
"status": 0,
|
|
|
"checkedPartner": []map[string]interface{}{},
|
|
|
"isSenior": userData.IsSenior,
|
|
|
}
|
|
|
if userData.IsSuperAdmin() {
|
|
|
result["isAdmin"] = 1
|
...
|
...
|
@@ -433,6 +434,9 @@ func (service UsersService) EditUserPermission(cmd command.EditUserPermissionCom |
|
|
transactionContext, _ = factory.CreateTransactionContext(nil)
|
|
|
err error
|
|
|
)
|
|
|
if err = cmd.Validate(); err != nil {
|
|
|
return lib.ThrowError(lib.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
if err = transactionContext.StartTransaction(); err != nil {
|
|
|
return lib.ThrowError(lib.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -501,9 +505,6 @@ func (service UsersService) EditUserPermission(cmd command.EditUserPermissionCom |
|
|
partners = append(partners, p)
|
|
|
}
|
|
|
for i := range permissionList {
|
|
|
// if permissionList[i].Code == domain.PERMINSSION_ADMIN_USER && !usersData.IsSuperAdmin() {
|
|
|
// return lib.ThrowError(lib.BUSINESS_ERROR, "操作异常")
|
|
|
// }
|
|
|
p := domain.AdminPermissionBase{
|
|
|
Id: permissionList[i].Id,
|
|
|
Code: permissionList[i].Code,
|
...
|
...
|
@@ -512,6 +513,7 @@ func (service UsersService) EditUserPermission(cmd command.EditUserPermissionCom |
|
|
}
|
|
|
updateMap := map[string]interface{}{
|
|
|
"AccessPartners": partners,
|
|
|
"IsSenior": cmd.IsSenior,
|
|
|
}
|
|
|
if !usersData.IsSuperAdmin() {
|
|
|
updateMap["Permission"] = permissionsBase
|
...
|
...
|
|