Package jease.cms.domain

Examples of jease.cms.domain.Access


   * HTTP-Authorization-Header. Returns null if no guard exists or
   * authorization against guard is successful, otherwise the Access-Guard is
   * returned, which should force an unauthorized-response.
   */
  public static Access check(Content content, String authorizationHeader) {
    Access access = getGuard(content);
    if (access != null) {
      String userpass = Crypts
          .decodeBasicAuthorization(authorizationHeader);
      if (userpass == null) {
        return access;
      }
      int index = userpass.indexOf(":");
      String login = userpass.substring(0, index);
      String password = userpass.substring(index + 1);
      if (!(Validations.equals(access.getLogin(), login) && access
          .hasPassword(password))) {
        return access;
      }
    }
    return null;
View Full Code Here


        cache.put(content, content.getGuard(Access.class));
      } else {
        cache.put(content, NO_ACCESS_GUARD);
      }
    }
    Access access = (Access) cache.get(content);
    return access != NO_ACCESS_GUARD ? access : null;
  }
View Full Code Here

TOP

Related Classes of jease.cms.domain.Access

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.