* <ol>
* <li>admin with admin role on sdn</li>
* <li>admin with user role on sdn</li>
- * <li>user with user role on sdn</li>
* </ol>
*
* @author peter.mellquist@hp.com
*
* @param domainID ID (same as name) of the "authentication domain"
* @return ID of the just newly created Domain, or null if no new one had to be created
- * @return true if initialization took place, false if it wasn't needed
* @throws IDMStoreException for issues coming from the IIDMStore
*/
public String initDomainAndRolesWithoutUsers(String domainID) throws IDMStoreException {
adminRole.setName("admin");
adminRole.setDomainid(newDomainID);
adminRole.setDescription("a role for admins");
- adminRole = store.writeRole(adminRole);
+ store.writeRole(adminRole);
LOG.info("Created 'admin' role");
Role userRole = new Role();
userRole.setName("user");
userRole.setDomainid(newDomainID);
userRole.setDescription("a role for users");
- userRole = store.writeRole(userRole);
+ store.writeRole(userRole);
LOG.info("Created 'user' role");
return newDomainID;
/**
* Initialize IIDMStore with the default domain and the 'user' and 'admin'
- * roles AND 2 default user accounts (with default passwords, which is bad practice).
+ * roles AND a default admin account (with default password, which is bad practice).
+ *
* @param domainID ID (same as name) of the "authentication domain"
* @throws IDMStoreException for issues coming from the IIDMStore
*/
String newDomainID = initDomainAndRolesWithoutUsers(domainID);
if (newDomainID != null) {
createUser(newDomainID, "admin", "admin", true);
- createUser(newDomainID, "user", "user", false);
}
}
grant.setDomainid(domainID);
grant.setUserid(userID);
grant.setRoleid(roleID);
- grant = store.writeGrant(grant);
+ store.writeGrant(grant);
LOG.debug("Granted '" + userID + "' user the '" + roleID + "' role in domain '" + domainID + "'");
}
}