|
|
@ -83,6 +83,7 @@ import java.net.URL;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
|
|
|
|
|
|
|
|
@ -278,14 +279,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
|
|
|
|
|
|
|
|
|
|
|
|
private void checkClientOrg(JSONObject manager, JSONObject client) {
|
|
|
|
private void checkClientOrg(JSONObject manager, JSONObject client) {
|
|
|
|
if (manager.getInteger("org_id")!=null){
|
|
|
|
if (manager.getInteger("org_id")!=null){
|
|
|
|
JSONObject org = orgMapper.findOne(client.getIntValue("org_id"));
|
|
|
|
List<JSONObject> orgs = orgMapper.listOrgAndChild(manager.getIntValue("org_id"));
|
|
|
|
if (org.getInteger("parent_org_id")!=null){
|
|
|
|
List<Integer> orgIds = orgs.stream().map(org->org.getIntValue("org_id")).collect(Collectors.toList());
|
|
|
|
if (org.getIntValue("org_id")!=manager.getIntValue("org_id")){
|
|
|
|
if (!orgIds.contains(client.getIntValue("org_id"))){
|
|
|
|
throw new ForbiddenException("The org of client is not belong to you");
|
|
|
|
throw new ForbiddenException("The org of client is not belong to you");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else {
|
|
|
|
|
|
|
|
checkOrgPermission(manager, client);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|