@Test public void forceWithExistingUserInLocalWiki() throws Exception { setupMocks("local"); User u = this.userManager.getUser("Admin", true); Assert.assertEquals("local:XWiki.Admin", u.getId()); Assert.assertTrue(u.exists()); }
@Override public User getUser(String identifier, boolean force) { if (StringUtils.isBlank(identifier)) { return null; } DocumentReference reference = getLocalReference(identifier); if (!this.bridge.exists(reference)) { reference = getDefaultReference(identifier); } if (!this.bridge.exists(reference)) { reference = getGlobalReference(identifier); } if (this.bridge.exists(reference)) { return new WikiUser(reference, this.serializer, this.bridge, this.explicitResolver); } return force ? new WikiUser(getDefaultReference(identifier), this.serializer, this.bridge, this.explicitResolver) : null; }
WikiUserManager extends AbstractUserManager implements Initializable { @Override public User getUser(String identifier, boolean force) { if (StringUtils.isBlank(identifier)) { return null; } DocumentReference reference = getLocalReference(identifier); if (!this.bridge.exists(reference)) { reference = getDefaultReference(identifier); } if (!this.bridge.exists(reference)) { reference = getGlobalReference(identifier); } if (this.bridge.exists(reference)) { return new WikiUser(reference, this.serializer, this.bridge, this.explicitResolver); } return force ? new WikiUser(getDefaultReference(identifier), this.serializer, this.bridge, this.explicitResolver) : null; } }
WikiUserManager extends AbstractUserManager implements Initializable { @Override public User getUser(String identifier, boolean force) { if (StringUtils.isBlank(identifier)) { return null; } DocumentReference reference = getLocalReference(identifier); if (!this.bridge.exists(reference)) { reference = getDefaultReference(identifier); } if (!this.bridge.exists(reference)) { reference = getGlobalReference(identifier); } if (this.bridge.exists(reference)) { return new WikiUser(reference, this.serializer, this.bridge, this.explicitResolver); } return force ? new WikiUser(getDefaultReference(identifier), this.serializer, this.bridge, this.explicitResolver) : null; }  }
WikiUserManager extends AbstractUserManager implements Initializable { @Override public User getUser(String identifier, boolean force) { if (StringUtils.isBlank(identifier)) { return null; } DocumentReference reference = getLocalReference(identifier); if (!this.bridge.exists(reference)) { reference = getDefaultReference(identifier); } if (!this.bridge.exists(reference)) { reference = getGlobalReference(identifier); } if (this.bridge.exists(reference)) { return new WikiUser(reference, this.serializer, this.bridge, this.explicitResolver); } return force ? new WikiUser(getDefaultReference(identifier), this.serializer, this.bridge, this.explicitResolver) : null; }  @Override void initialize(); @Override User getUser(String identifier, boolean force); }
WikiUserManager extends AbstractUserManager implements Initializable { @Override public User getUser(String identifier, boolean force) { if (StringUtils.isBlank(identifier)) { return null; } DocumentReference reference = getLocalReference(identifier); if (!this.bridge.exists(reference)) { reference = getDefaultReference(identifier); } if (!this.bridge.exists(reference)) { reference = getGlobalReference(identifier); } if (this.bridge.exists(reference)) { return new WikiUser(reference, this.serializer, this.bridge, this.explicitResolver); } return force ? new WikiUser(getDefaultReference(identifier), this.serializer, this.bridge, this.explicitResolver) : null; }  @Override void initialize(); @Override User getUser(String identifier, boolean force);  }