final UserAccountBean userBean,
final UnitPermission permissionBean)
throws EnMeExpcetion
{
UserAccount userDomain = null;
Permission permissionDomain = null;
log.info("userBean found "+userBean.getId());
log.info("permissionBean found "+permissionBean.getId());
if (userBean.getId() != null) {
userDomain = getAccountDao().getUserAccountById(userBean.getId());
log.info("user found "+userDomain);
}
if (permissionBean.getId() != null) {
permissionDomain = getPermissionDao().getPermissionById(permissionBean.getId());
log.info("permission found "+permissionDomain);
}
if (userDomain != null && permissionDomain != null) {
log.info("saving permissions");
log.info("permission selected "+permissionDomain.getPermission());
log.info("user selected "+userDomain.getUid());
userDomain.getSecUserPermissions().add(permissionDomain);
getAccountDao().saveOrUpdate(userDomain);
log.info("saved permission "+userDomain.getSecUserPermissions().size());
} else {