}
}
private void setupRoles() {
if (Database.query(Role.class).isEmpty()) {
Role administrator = new Role();
administrator.setName(I18N.get("Administrator"));
administrator.setAdministrator(true);
administrator.setTypes(Contents.getClassNamesForAvailableTypes());
Database.save(administrator);
Role editor = new Role();
editor.setName(I18N.get("Editor"));
editor.setTypes(Functors.filter(
Contents.getClassNamesForAvailableTypes(),
new Predicate<String>() {
public boolean test(String type) {
return !(type.equals(Factory.class.getName())
|| type.equals(Script.class.getName()) || type