study.setSecurityProfile(sp);
} else {
study.inheritPermissions(project);
}
if (!study.userCanWrite(user)) {
throw new SecurityException("Permission denied.");
}
model.put("formObj", study);
model.put("study", study);
model.put("owners", LimsSecurityUtils.getPotentialOwners(user, study, securityManager.listAllUsers()));