Ejemplo n.º 1
0
  protected List<String> getUserRolesFromConfig(String property) throws IOException {
    List<String> res = null;

    {
      if (property != null) {
        ConfigFactory f = DefaultConfigFactory.getInstance();
        Config c = f.getConfig();

        String v = c.getProperty(property); // re-read; marks property read in 'Config'-impl. cache

        res = parseStringList(v);
      }
    }

    return res;
  }
Ejemplo n.º 2
0
  protected String getUserPresentationNameFromConfig(Principal userPrincipal) throws IOException {
    String res = null;

    {
      if (userPrincipal != null) {
        String userName = PrincipalUtil.getNameStripped(userPrincipal);

        if (userName != null) {
          String property = "security.authorization.user." + userName + ".presentation-name";

          ConfigFactory f = DefaultConfigFactory.getInstance();
          Config c = f.getConfig();

          res = c.getProperty(property);
        }
      }
    }

    return res;
  }