use of org.apache.ranger.entity.XXRoleRefRole 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;
}
use of org.apache.ranger.entity.XXRoleRefRole in project ranger by apache.
the class XXRoleRefRoleDao method getContainingRoles.
public Set<Long> getContainingRoles(Long subRoleId) {
Set<Long> ret;
List<XXRoleRefRole> roles = findBySubRoleId(subRoleId);
if (CollectionUtils.isNotEmpty(roles)) {
ret = new HashSet<>();
for (XXRoleRefRole role : roles) {
ret.add(role.getRoleId());
}
} else {
ret = Collections.EMPTY_SET;
}
return ret;
}
Aggregations