checkAuthorization(Permissions.CREATE, Resources.USER, null);
return new UserEntity(userId);
}
public User saveUser(User user) {
UserEntity userEntity = (UserEntity) user;
// encrypt password
userEntity.encryptPassword();
if(userEntity.getRevision() == 0) {
checkAuthorization(Permissions.CREATE, Resources.USER, null);
getDbEntityManager().insert(userEntity);
createDefaultAuthorizations(userEntity);
} else {
checkAuthorization(Permissions.UPDATE, Resources.USER, user.getId());