Package ch.entwine.weblounge.common.impl.security

Examples of ch.entwine.weblounge.common.impl.security.RoleImpl


    if (account.getLanguage() != null)
      wu.setLanguage(LanguageUtils.getLanguage(account.getLanguage()));
    if (account.getResponse() != null)
      wu.setResponse(account.getResponse().getBytes(Charset.forName("utf-8")), DigestType.md5);
    for (JpaRole r : account.getRoles()) {
      wu.addPublicCredentials(new RoleImpl(r.getContext(), r.getRolename()));
    }

    return Response.ok(wu.toXml()).build();
  }
View Full Code Here


   * @param value
   *          the role
   */
  public void setRole(String value) throws JspTagException {
    try {
      oneOf.add(new RoleImpl(value));
      allOf.add(new RoleImpl(value));
    } catch (IllegalArgumentException e) {
      throw new JspTagException(e);
    }
  }
View Full Code Here

    StringTokenizer tok = new StringTokenizer(value, ",; ");
    String role;
    while (tok.hasMoreTokens()) {
      role = tok.nextToken();
      try {
        oneOf.add(new RoleImpl(role));
      } catch (IllegalArgumentException e) {
        throw new JspTagException(e);
      }
    }
  }
View Full Code Here

    StringTokenizer tok = new StringTokenizer(value, ",");
    String role;
    while (tok.hasMoreTokens()) {
      role = tok.nextToken();
      try {
        allOf.add(new RoleImpl(role));
      } catch (IllegalArgumentException e) {
        throw new JspTagException(e);
      }
    }
  }
View Full Code Here

  @Override
  public int doStartTag() throws JspException {
    if (context != null && id != null) {
      Role role;
      try {
        role = new RoleImpl(context + ":" + id);
      } catch (IllegalArgumentException e) {
        throw new JspTagException(e);
      }
      allOf.add(role);
      oneOf.add(role);
View Full Code Here

        Collection<? extends GrantedAuthority> authorities = auth.getAuthorities();
        if (authorities != null && authorities.size() > 0) {
          for (GrantedAuthority ga : authorities) {
            logger.debug("Principal '{}' gained role '{}'", user.getLogin(), ga.getAuthority());
            roles.add(new RoleImpl(ga.getAuthority()));
          }
        }

      } else if (Security.ANONYMOUS_USER.equals(principal)) {
        user = new Guest(site.getIdentifier());
View Full Code Here

   * @return the local role
   */
  protected Role getLocalRole(Site site, Role role) {
    String localRole = site.getLocalRole(role.getIdentifier());
    if (StringUtils.isNotBlank(localRole))
      return new RoleImpl(site.getIdentifier(), localRole);
    return role;
  }
View Full Code Here

    // Try to send users to an appropriate welcome page based on their roles
    for (Map.Entry<String, String> entry : welcomePages.entrySet()) {
      String roleId = entry.getKey();
      String welcomePage = entry.getValue();
      if (SecurityUtils.userHasRole(user, new RoleImpl(roleId))) {
        response.sendRedirect(addTimeStamp(welcomePage));
        return;
      }
    }
View Full Code Here

          user.addPublicCredentials(EDITOR);
        } else if (GUEST.getIdentifier().equals(r.getRolename())) {
          user.addPublicCredentials(GUEST);
        }
      } else {
        user.addPublicCredentials(new RoleImpl(r.getContext(), r.getRolename()));
      }
    }

    return user;
  }
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.impl.security.RoleImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.