public void setSignedOff(long projectId, AccElementType type, long elementId,
boolean isSignedOff) {
ServletUtils.requireAccess(userService.hasEditAccess(projectId));
PersistenceManager pm = pmf.getPersistenceManager();
try {
Signoff signoff = getSignoff(type, elementId);
if (signoff == null) {
signoff = new Signoff();
signoff.setParentProjectId(projectId);
signoff.setElementType(type);
signoff.setElementId(elementId);
} else {
if (signoff.getParentProjectId() != projectId) {
ServletUtils.requireAccess(false);
}
}
signoff.setSignedOff(isSignedOff);
pm.makePersistent(signoff);
} finally {
pm.close();
}
}