X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=aaa-authn-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Faaa%2Fapi%2FStoreBuilder.java;h=76c1f0a9a5c3a3b88b9867fc5e27cbadb6df805c;hb=1013aa9930971da2c4ba0ea6d772da6cce98a49e;hp=dba449f5d6bb62343004f49ef471323543061250;hpb=7947038229e39fdfb8cac98cf279ae6464ac6120;p=aaa.git diff --git a/aaa-authn-api/src/main/java/org/opendaylight/aaa/api/StoreBuilder.java b/aaa-authn-api/src/main/java/org/opendaylight/aaa/api/StoreBuilder.java index dba449f5d..76c1f0a9a 100644 --- a/aaa-authn-api/src/main/java/org/opendaylight/aaa/api/StoreBuilder.java +++ b/aaa-authn-api/src/main/java/org/opendaylight/aaa/api/StoreBuilder.java @@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory; *
    *
  1. admin with admin role on sdn
  2. *
  3. admin with user role on sdn
  4. - *
  5. user with user role on sdn
  6. *
* * @author peter.mellquist@hp.com @@ -76,7 +75,6 @@ public class StoreBuilder { * * @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 { @@ -106,14 +104,14 @@ public class StoreBuilder { 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; @@ -121,7 +119,8 @@ public class StoreBuilder { /** * 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 */ @@ -129,7 +128,6 @@ public class StoreBuilder { String newDomainID = initDomainAndRolesWithoutUsers(domainID); if (newDomainID != null) { createUser(newDomainID, "admin", "admin", true); - createUser(newDomainID, "user", "user", false); } } @@ -209,7 +207,7 @@ public class StoreBuilder { 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 + "'"); } }