int personId = ((Integer)session.save(person)).intValue();
session.save(new RoleAssociation(projectId, personId, getRoleId(session, "admin")));
addPermission(session, personId, "system.project", 1, "testpermission");
session.flush();
session.connection().commit();
SystemAuthorizer.set(new AuthorizerImpl());
ThreadSession.set(session);