use of org.apache.ranger.db.XXPolicyResourceDao in project ranger by apache.
the class ServiceDBStore method deleteExistingPolicyResources.
private Boolean deleteExistingPolicyResources(RangerPolicy policy) {
if (policy == null) {
return false;
}
List<XXPolicyResource> resources = daoMgr.getXXPolicyResource().findByPolicyId(policy.getId());
XXPolicyResourceDao resDao = daoMgr.getXXPolicyResource();
for (XXPolicyResource resource : resources) {
List<XXPolicyResourceMap> resMapList = daoMgr.getXXPolicyResourceMap().findByPolicyResId(resource.getId());
XXPolicyResourceMapDao resMapDao = daoMgr.getXXPolicyResourceMap();
for (XXPolicyResourceMap resMap : resMapList) {
resMapDao.remove(resMap);
}
resDao.remove(resource);
}
return true;
}
Aggregations