use of org.apache.ranger.db.XXRoleRefRoleDao in project ranger by apache.
the class RoleRefUpdater method cleanupRefTables.
public Boolean cleanupRefTables(RangerRole rangerRole) {
final Long roleId = rangerRole.getId();
if (roleId == null) {
return false;
}
XXRoleRefUserDao xRoleUserDao = daoMgr.getXXRoleRefUser();
XXRoleRefGroupDao xRoleGroupDao = daoMgr.getXXRoleRefGroup();
XXRoleRefRoleDao xRoleRoleDao = daoMgr.getXXRoleRefRole();
for (XXRoleRefUser xxRoleRefUser : xRoleUserDao.findByRoleId(roleId)) {
xRoleUserDao.remove(xxRoleRefUser);
}
for (XXRoleRefGroup xxRoleRefGroup : xRoleGroupDao.findByRoleId(roleId)) {
xRoleGroupDao.remove(xxRoleRefGroup);
}
for (XXRoleRefRole xxRoleRefRole : xRoleRoleDao.findByRoleId(roleId)) {
xRoleRoleDao.remove(xxRoleRefRole);
}
return true;
}
Aggregations