use of com.nike.cerberus.record.UserGroupRecord in project cerberus by Nike-Inc.
the class UserGroupPermissionService method getUserGroupPermissions.
public Set<UserGroupPermission> getUserGroupPermissions(final String safeDepositBoxId) {
final Set<UserGroupPermission> permissionsSet = Sets.newHashSet();
final List<UserGroupPermissionRecord> permissionRecords = userGroupDao.getUserGroupPermissions(safeDepositBoxId);
permissionRecords.forEach(r -> {
final Optional<UserGroupRecord> userGroupRecord = userGroupDao.getUserGroup(r.getUserGroupId());
if (userGroupRecord.isPresent()) {
UserGroupPermission permission = new UserGroupPermission();
permission.setId(r.getId());
permission.setRoleId(r.getRoleId());
permission.setName(userGroupRecord.get().getName());
permission.setCreatedBy(r.getCreatedBy());
permission.setCreatedTs(r.getCreatedTs());
permission.setLastUpdatedBy(r.getLastUpdatedBy());
permission.setLastUpdatedTs(r.getLastUpdatedTs());
permissionsSet.add(permission);
}
});
return permissionsSet;
}
Aggregations