{
app = new SkeletonKeyApplication(confgurable);
try
{
StoredUser admin = new StoredUser();
admin.setName("Bill");
admin.setId("1");
admin.setUsername("admin");
HashMap<String, String> creds = new HashMap<String, String>();
creds.put("password", "geheim");
admin.setCredentials(creds);
app.getUsers().create(admin);
Project project = new Project();
project.setName("Skeleton Key");
project.setEnabled(true);
app.getProjects().createProject(project);
Role adminRole = new Role();
adminRole.setName("admin");
app.getRoles().create(adminRole);
app.getProjects().addUserRole(project.getId(), admin.getId(), adminRole.getId());
project = new Project();
project.setId("42");
project.setName("Skeleton App");
project.setEnabled(true);
app.getProjects().createProject(project);
Role userRole = new Role();
userRole.setName("user");
app.getRoles().create(userRole);
StoredUser user = new StoredUser();
user.setName("Some User");
user.setUsername("someuser");
creds = new HashMap<String, String>();
creds.put("password", "geheim");
user.setCredentials(creds);
app.getUsers().create(user);
app.getProjects().addUserRole(project.getId(), user.getId(), userRole.getId());
StoredUser superuser = new StoredUser();
superuser.setName("Super User");
superuser.setUsername("superuser");
creds = new HashMap<String, String>();
creds.put("password", "geheim");
superuser.setCredentials(creds);
app.getUsers().create(superuser);
app.getProjects().addUserRole(project.getId(), superuser.getId(), adminRole.getId());
}
catch (Exception e)
{
throw new RuntimeException(e);
}