public Builder addDataAccessRestrictions(String dataItem, String... roles) {
String[] existingRestrictions = caseFile.getAccessRestrictions().get(dataItem);
if (existingRestrictions == null) {
existingRestrictions = roles;
} else {
String[] result = new String[existingRestrictions.length + roles.length];
System.arraycopy(existingRestrictions, 0, result, 0, existingRestrictions.length);
System.arraycopy(roles, 0, result, existingRestrictions.length, roles.length);
existingRestrictions = result;
}
caseFile.getAccessRestrictions().put(dataItem, existingRestrictions);
return this;
}
}