Esempio n. 1
0
  protected boolean isUserAuthorized(final String token, final List<String> accessRights) {

    final String sessionId = new String(Session.getParameter("session_id"));

    final String calcSHA1 = SHA1.calcSHA1(token.concat(sessionId));

    if (accessRights.contains(calcSHA1.toUpperCase())) {
      return true;
    }

    return false;
  }
Esempio n. 2
0
  protected boolean isUserAuthorized(
      final List<String> privileges, final List<String> accessRights) {

    final String sessionId = new String(Session.getParameter("session_id"));

    for (final String privilege : privileges) {

      final String calcSHA1 = SHA1.calcSHA1(privilege.concat(sessionId));

      if (accessRights.contains(calcSHA1.toUpperCase())) {
        GWT.log("User is granted access to targeted page thanks to : " + privilege);
        return true;
      }
    }

    return false;
  }