...
|
...
|
@@ -60,6 +60,9 @@ func RoleDelete(param protocol.RequestRoleDelete) error { |
|
|
log.Error(e.Error())
|
|
|
return protocol.NewErrWithMessage("1", e)
|
|
|
}
|
|
|
if ok := role.IsDefaultRole(); ok {
|
|
|
return protocol.NewErrWithMessage("10006")
|
|
|
}
|
|
|
if role.CompanyId != param.CompanyID {
|
|
|
e := fmt.Errorf("role.CompanyId(%d) != param.CompanyID(%d)", role.CompanyId, param.CompanyID)
|
|
|
log.Error(e.Error())
|
...
|
...
|
@@ -98,6 +101,12 @@ func RoleEdit(param protocol.RequestRoleEdit) (*protocol.ResponseRoleInfo, error |
|
|
log.Error(e.Error())
|
|
|
return nil, protocol.NewErrWithMessage("1", e)
|
|
|
}
|
|
|
if ok := role.IsDefaultRole(); ok && role.Types == models.ROLETYPES_ROLE {
|
|
|
return nil, protocol.NewErrWithMessage("10005")
|
|
|
}
|
|
|
if ok := role.IsDefaultRole(); ok && role.Types == models.ROLETYPES_GROUP {
|
|
|
return nil, protocol.NewErrWithMessage("10006")
|
|
|
}
|
|
|
if role.CompanyId != param.CompanyID {
|
|
|
e := fmt.Errorf("role.CompanyId(%d) != param.CompanyID(%d)", role.CompanyId, param.CompanyID)
|
|
|
log.Error(e.Error())
|
...
|
...
|
@@ -142,6 +151,9 @@ func RoleGroupDelete(param protocol.RequestRoleDelete) error { |
|
|
log.Error(e.Error())
|
|
|
return protocol.NewErrWithMessage("1", e)
|
|
|
}
|
|
|
if ok := roleinfo.IsDefaultRole(); ok {
|
|
|
return protocol.NewErrWithMessage("10005")
|
|
|
}
|
|
|
if roleinfo.CompanyId != param.CompanyID {
|
|
|
e := fmt.Errorf("roleinfo.CompanyId(%d) != param.CompanyID(%d)", roleinfo.CompanyId, param.CompanyID)
|
|
|
log.Error(e.Error())
|
...
|
...
|
|