Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.Principal


    DocumentList list = getObjectUnderTest(37, 1, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, LOCAL_NAMESPACE, "group1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLGROUPS, "group1"));
  }
View Full Code Here


    DocumentList list = getObjectUnderTest(38, 0, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLUSERS, "user1"));
  }
View Full Code Here

    DocumentList list = getObjectUnderTest(38, 0, 1001);
    Document doc = list.nextDocument();
    assertNotNull(doc);
    assertEquals(
        new Principal(UNKNOWN, GLOBAL_NAMESPACE, "user1",
            EVERYTHING_CASE_SENSITIVE),
        getAclPrincipal(doc, SpiConstants.PROPNAME_ACLUSERS, "user1"));
  }
View Full Code Here

    if (netbiosName != null) {
      principalName = netbiosName + AdConstants.BACKSLASH + samAccountName;
    } else {
      principalName = samAccountName;
    }
    return new Principal(PrincipalType.UNKNOWN, globalNamespace, principalName);
  }
View Full Code Here

  public void addAclGroupToDocument(String globalNamespace,
      String principalName) {
   if (aclGroups == null) {
     aclGroups = Sets.newHashSet();
   }
   aclGroups.add(new Principal(SpiConstants.PrincipalType.UNKNOWN,
       globalNamespace, principalName,
       CaseSensitivityType.EVERYTHING_CASE_INSENSITIVE));
  }
View Full Code Here

   * @param scope the site collection URL for the group
   * @param groupName the name for the group
   */
  public static Principal getSharePointGroupPrincipal(String namespace,
      String scope, String groupName) {
    return new Principal(UNQUALIFIED, namespace,
        "[" + scope + "]" + groupName, EVERYTHING_CASE_INSENSITIVE);
  }
View Full Code Here

          response.isValid());

      assertFalse(
          "New user mustn't belong to the group he belonged to prior deletion",
          response.getGroups().contains(
              new Principal(group.sAMAccountName.toLowerCase())));

      // add new user as member to the group
      ad.initialize();
      group.children.add(user);
      ad.setMembers(false, group);
      s.getTraversalManager().resumeTraversal(null);

      // delete the group, create the same one with different GUID
      ad.deleteEntity(group);
      ad.createGroup(false, group, ou);
      s.getTraversalManager().resumeTraversal(null);

      response = s.getAuthenticationManager().authenticate(
          new SimpleAuthenticationIdentity(
              user.sAMAccountName, TestConfiguration.password));

      assertTrue("User from resurrected group can be authenticated",
          response.isValid());

      assertFalse("User must not belong to resurrected group",
          response.getGroups().contains(new Principal(
              group.sAMAccountName.toLowerCase())));
    }
  }
View Full Code Here

    assertNotNull(format3);
    assertEquals(expectedGroupNameFormat, format3);
  }

  public void testGetSharePointGroupPrincipal() {
    assertEquals(new Principal(UNQUALIFIED, "ns", "[url]name",
            EVERYTHING_CASE_INSENSITIVE),
        Util.getSharePointGroupPrincipal("ns", "url", "name"));
  }
View Full Code Here

    Set<Principal> spGroups =
        userDataStoreDAO.getSharePointGroupsForSearchUserAndLdapGroups(
            "ns", ldapGroups, "user1");
    String expectedGroup = String.format("[%s]%s", namespace, "group1");
    Set<Principal> expectedGroups = ImmutableSet.of(
        new Principal(UNQUALIFIED, "ns", expectedGroup,
            EVERYTHING_CASE_INSENSITIVE));
    assertEquals(expectedGroups, spGroups);
 
View Full Code Here

    SmbAclBuilder builder = new SmbAclBuilder(smbFile, fetcher);
    Acl acl = builder.getShareAcl();
    assertNotNull(acl);
    assertNotNull(acl.getGroups());
    assertFalse(acl.getGroups().isEmpty());
    Principal p = acl.getGroups().iterator().next();
    assertNotNull(p);
    assertEquals("accountants@google", p.getName());
    assertEquals(GLOBAL_NAMESPACE, p.getNamespace());
    assertEquals(AclFormat.USER_AT_DOMAIN.getPrincipalType(),
                 p.getPrincipalType());
    assertEquals(CaseSensitivityType.EVERYTHING_CASE_INSENSITIVE,
        p.getCaseSensitivityType());
    assertTrue(acl.getUsers().isEmpty());
    assertTrue(acl.getDenyUsers().isEmpty());
    assertTrue(acl.getDenyGroups().isEmpty());
    verify(smbFile);
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.Principal

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.