Transaction tx = null;
try {
tx = session.beginTransaction();
User user = (User) session.get(User.class, username);
Area area = (Area) session.get(Area.class, areaName);
if ((area != null && (area.isAdmin(username) || area.isEditor(username)))
|| (user != null && user.isMasterAdmin())) {
//TODO: Check the area for LDAP groups here as well
hasPermission = true;
System.out.println("approved edit-permission for user " + authentication.getName()
+ " area: " + areaName);