Package com.google.enterprise.connector.notes.client

Examples of com.google.enterprise.connector.notes.client.NotesACLEntry


  /** {@inheritDoc} */
  @Override
  public NotesACLEntry getNextEntry() throws RepositoryException {
    LOGGER.entering(CLASS_NAME, "getNextEntry");
    if (index < entries.size()) {
      NotesACLEntry entry = entries.get(index);
      ++index;
      return entry;
    }
    return null;
  }
View Full Code Here


  @VisibleForTesting
  void getPermitDeny(NotesACL acl, List<String> permitUsers,
      List<String> permitGroups, List<String> noAccessUsers,
      List<String> noAccessGroups, NotesSession ns) throws RepositoryException {
    final String METHOD = "getPermitDeny";
    NotesACLEntry ae = acl.getFirstEntry();
    while (ae != null) {
      LOGGER.logp(Level.FINER, CLASS_NAME, METHOD,
          "Checking ACL Entry: " + ae.getName());
      int userType = ae.getUserType();
      // If this is a user explicitly listed with NO ACCESS
      if (NotesACL.LEVEL_DEPOSITOR > ae.getLevel()) {
        // Send both specified and unspecified users with NO ACCESS to GSA as
        // DENY users.  As a result, unspecified groups with NO ACCESS will also
        // be included in the DENY user list but they will not have any impact
        // to authenticated users.
        if ((userType == NotesACLEntry.TYPE_PERSON) ||
            (userType == NotesACLEntry.TYPE_UNSPECIFIED)) {
          LOGGER.logp(Level.FINER, CLASS_NAME, METHOD,
              "Adding the user entry to deny list: " + ae.getName());
          noAccessUsers.add(ae.getName().toLowerCase());
        }
        // Skip unspecified groups such as -Default- and Anonymous.
        // Do not need to send deny access for groups and unspecified groups.
      }

      // If this entry has an access level greater than DEPOSITOR
      if (NotesACL.LEVEL_DEPOSITOR < ae.getLevel()) {
        // Add to the PERMIT USERS if they are a user
        if ((userType == NotesACLEntry.TYPE_PERSON) ||
            (userType == NotesACLEntry.TYPE_UNSPECIFIED)) {
          LOGGER.logp(Level.FINER, CLASS_NAME, METHOD,
              "Adding the user entry to person allow list: " + ae.getName());
          permitUsers.add(ae.getName().toLowerCase());
        }
        // Add to the PERMIT GROUPS if they are a group
        if  ((userType == NotesACLEntry.TYPE_MIXED_GROUP) ||
            (userType == NotesACLEntry.TYPE_PERSON_GROUP) ||
            (userType == NotesACLEntry.TYPE_UNSPECIFIED)) {
          LOGGER.logp(Level.FINER, CLASS_NAME, METHOD,
              "Adding the user entry to group allow list: " + ae.getName());
          permitGroups.add(ae.getName().toLowerCase());
        }
      }
      NotesACLEntry prevae = ae;
      ae = acl.getNextEntry(prevae);
      prevae.recycle();
    }
  }
View Full Code Here

      String databaseReplicaId) {
    final String METHOD = "updateRolesForDatabase";
    LOGGER.entering(CLASS_NAME, METHOD);

    NotesACL acl = null;
    NotesACLEntry aclEntry = null;
    try {
      conn.setAutoCommit(false);
      deleteRolesForDatabase(databaseReplicaId);
      acl = crawlDatabase.getACL();
      for (aclEntry = acl.getFirstEntry();
           aclEntry != null;
           aclEntry = getNextAclEntry(acl, aclEntry)) {
        Vector roles = aclEntry.getRoles();
        if (LOGGER.isLoggable(Level.FINEST)) {
          LOGGER.logp(Level.FINEST, CLASS_NAME, METHOD,
              "Acl entry: " + aclEntry.getName() + "; with roles: " + roles);
        }
        int roleType = aclEntry.getUserType();
        switch (roleType) {
          case NotesACLEntry.TYPE_PERSON:
            updateRolesForUser(aclEntry.getName(), databaseReplicaId, roles);
            break;
          case NotesACLEntry.TYPE_SERVER:
          case NotesACLEntry.TYPE_SERVER_GROUP:
            break;
          default: // Treat all other cases as groups.
            updateRolesForGroup(aclEntry.getName(), databaseReplicaId, roles);
            break;
        }
      }
      conn.commit();
    } catch (Exception e) {
View Full Code Here

    return nextEntry;
  }

  private NotesACLEntry getNextAclEntry(NotesACL acl, NotesACLEntry aclEntry)
      throws RepositoryException {
    NotesACLEntry nextEntry = acl.getNextEntry(aclEntry);
    Util.recycle(aclEntry);
    return nextEntry;
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.notes.client.NotesACLEntry

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.