• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GroupPrincipal类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.enterprise.adaptor.GroupPrincipal的典型用法代码示例。如果您正苦于以下问题:Java GroupPrincipal类的具体用法?Java GroupPrincipal怎么用?Java GroupPrincipal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GroupPrincipal类属于com.google.enterprise.adaptor包,在下文中一共展示了GroupPrincipal类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDocIds

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
/** Crawls/pushes all groups from all AdServers. */

  @Override
  public void getDocIds(DocIdPusher pusher) throws InterruptedException,
      IOException {
    log.log(Level.FINER, "getDocIds invoked - waiting for lock.");
    mutex.lock();
    try {
      clearLastCompleteGroupCatalog();
      GroupCatalog cumulativeCatalog = makeFullCatalog();
      // all servers were able to successfully populate the catalog: do a push
      // TODO(myk): Rework the structure so that a member variable of
      // cumulativeCatalog isn't passed in as a parameter to its own method.
      cumulativeCatalog.resolveForeignSecurityPrincipals(
          cumulativeCatalog.entities);
      Map<GroupPrincipal, List<Principal>> groups =
          cumulativeCatalog.makeDefs(cumulativeCatalog.entities);
      pusher.pushGroupDefinitions(groups, EVERYTHING_CASE_INSENSITIVE, REPLACE,
          null, null);
      // no longer clear cumulativeCatalog.members as part of fix for b/18028678
      lastCompleteGroupCatalog = cumulativeCatalog;
    } finally {
      mutex.unlock();
      log.log(Level.FINE, "getDocIds ending - lock released.");
    }
  }
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:27,代码来源:AdAdaptor.java


示例2: testGroupCatalogMakeDefsWithDisabledGroup

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGroupCatalogMakeDefsWithDisabledGroup() throws Exception {
  AdAdaptor.GroupCatalog groupCatalog = new GroupCatalogBuilder().build();

  MockLdapContext ldapContext = mockLdapContextForMakeDefs(true);

  AdServer adServer = new AdServer("localhost", "" /*userSearchBaseDN*/,
      "" /*groupSearchBaseDN*/, "" /*userSearchFilter*/,
      "" /*groupSearchFilter*/, ldapContext);
  adServer.initialize();

  groupCatalog.readEverythingFrom(adServer, /*includeMembers=*/ true);

  tweakGroupCatalogForMakeDefs(groupCatalog, adServer, true);

  final Map<GroupPrincipal, List<Principal>> golden =
      new HashMap<GroupPrincipal, List<Principal>>();
  {
    golden.put(new GroupPrincipal("[email protected]", "example.com"),
        Collections.<Principal>emptyList());
    golden.put(new GroupPrincipal("known_group", "example.com"),
        Collections.<Principal>emptyList());
  }
  assertEquals(golden, groupCatalog.makeDefs(groupCatalog.entities));
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:26,代码来源:AdAdaptorTest.java


示例3: testFakeAdaptorUserAndPasswordSpecified

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testFakeAdaptorUserAndPasswordSpecified() throws Exception {
  AdAdaptor adAdaptor = new FakeAdaptor();
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  Map<String, String> configEntries = new HashMap<String, String>();
  configEntries.put("gsa.hostname", "localhost");
  configEntries.put("ad.servers", "server1");
  configEntries.put("ad.servers.server1.host", "localhost");
  configEntries.put("ad.servers.server1.port", "1234");
  configEntries.put("ad.servers.server1.user", "username");
  configEntries.put("ad.servers.server1.password", "password");
  configEntries.put("ad.servers.server1.method", "ssl");
  configEntries.put("ad.userSearchBaseDN", "ou=DoesNotMatter");
  configEntries.put("server.port", "5680");
  configEntries.put("server.dashboardPort", "5681");
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ true);
  Map<GroupPrincipal, Collection<Principal>> results =
      pusher.getGroupDefinitions();
  // the above (eventually) calls AdAdaptor.init() with the specified config.
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:22,代码来源:AdAdaptorTest.java


示例4: testFakeAdaptorDefaultUserAndPasswordSpecified

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testFakeAdaptorDefaultUserAndPasswordSpecified()
    throws Exception {
  AdAdaptor adAdaptor = new FakeAdaptor();
  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  Map<String, String> configEntries = new HashMap<String, String>();
  configEntries.put("gsa.hostname", "localhost");
  configEntries.put("ad.servers", "server1");
  configEntries.put("ad.servers.server1.host", "localhost");
  configEntries.put("ad.servers.server1.port", "1234");
  configEntries.put("ad.servers.server1.method", "ssl");
  configEntries.put("ad.defaultUser", "defaultUser");
  configEntries.put("ad.defaultPassword", "defaultPassword");
  configEntries.put("ad.groupSearchBaseDN", "ou=DoesNotMatter");
  configEntries.put("server.port", "5680");
  configEntries.put("server.dashboardPort", "5681");
  pushGroupDefinitions(adAdaptor, configEntries, pusher, /*fullPush=*/ true,
      /*init=*/ true);
  Map<GroupPrincipal, Collection<Principal>> results =
      pusher.getGroupDefinitions();
  // the above (eventually) calls AdAdaptor.init() with the specified config.
}
 
开发者ID:googlegsa,项目名称:activedirectory,代码行数:23,代码来源:AdAdaptorTest.java


示例5: listMembers

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
private void listMembers(MemberService memberService, long id,
    Set<UserPrincipal> users, Set<GroupPrincipal> groups)
    throws SOAPFaultException {
  List<Member> members = memberService.listMembers(id);
  for (Member member : members) {
    if (!isActive(member)) {
      log.log(Level.FINEST, "Is not active: " + member.getName());
      continue;
    }
    if ("User".equals(member.getType())) {
      users.add(getUserPrincipal(member));
    } else if ("Group".equals(member.getType())) {
      groups.add(getGroupPrincipal(member));
    } else if ("ProjectGroup".equals(member.getType())) {
      // ProjectGroups can be references to parent
      // ProjectGroups when, for example, a Project is nested
      // within another Project.
      listMembers(memberService, member.getID(), users, groups);
    }
  }
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:22,代码来源:OpentextAdaptor.java


示例6: testGetDocIdsMarkPublicFalse

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGetDocIdsMarkPublicFalse() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  config.overrideKey("adaptor.markAllDocsAsPublic", "false");
  adaptor.init(context);

  soapFactory.memberServiceMock.addMember(
      getMember(1000, "user1", "User"));
  soapFactory.memberServiceMock.addMember(
      getMember(2000, "group1", "Group"));
  soapFactory.memberServiceMock.addMemberToGroup(
      2000, soapFactory.memberServiceMock.getMemberById(1000));

  RecordingDocIdPusher pusher = new RecordingDocIdPusher();
  adaptor.getDocIds(pusher);
  Map<GroupPrincipal, List<Principal>> expected =
      new HashMap<GroupPrincipal, List<Principal>>();
  expected.put(newGroupPrincipal("group1"),
      Lists.<Principal>newArrayList(newUserPrincipal("user1")));
  assertEquals(expected, pusher.getGroupDefinitions());
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:25,代码来源:OpentextAdaptorTest.java


示例7: testGetGroupsDeletedUser

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGetGroupsDeletedUser() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  Member active = getMember(1, "user1", "User");
  Member deleted = getMember(2, "user2", "User");
  deleted.setDeleted(true);
  Member group = getMember(11, "group1", "Group");
  soapFactory.memberServiceMock.addMember(active);
  soapFactory.memberServiceMock.addMember(deleted);
  soapFactory.memberServiceMock.addMember(group);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), active);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), deleted);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);
  OpentextAdaptor.Groups groups =
      adaptor.new Groups(soapFactory.newMemberService());
  groups.addGroups();
  Map<GroupPrincipal, List<Principal>> groupDefinitions =
      groups.getGroupDefinitions();
  assertEquals(Lists.newArrayList(newUserPrincipal("user1")),
      groupDefinitions.get(newGroupPrincipal("group1")));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:26,代码来源:OpentextAdaptorTest.java


示例8: testGetGroupsDeletedGroup

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGetGroupsDeletedGroup() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  Member active = getMember(1, "user1", "User");
  Member group = getMember(11, "group1", "Group");
  group.setDeleted(true);
  soapFactory.memberServiceMock.addMember(active);
  soapFactory.memberServiceMock.addMember(group);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), active);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);
  OpentextAdaptor.Groups groups =
      adaptor.new Groups(soapFactory.newMemberService());
  groups.addGroups();
  Map<GroupPrincipal, List<Principal>> groupDefinitions =
      groups.getGroupDefinitions();
  assertEquals(null, groupDefinitions.get(newGroupPrincipal("group1")));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:22,代码来源:OpentextAdaptorTest.java


示例9: testGetGroupsDeletedMemberGroup

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGetGroupsDeletedMemberGroup() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  Member active = getMember(1, "user1", "User");
  Member memberGroup = getMember(2, "memberGroup", "Group");
  memberGroup.setDeleted(true);
  Member group = getMember(11, "group1", "Group");
  soapFactory.memberServiceMock.addMember(active);
  soapFactory.memberServiceMock.addMember(memberGroup);
  soapFactory.memberServiceMock.addMember(group);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), active);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), memberGroup);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);
  OpentextAdaptor.Groups groups =
      adaptor.new Groups(soapFactory.newMemberService());
  groups.addGroups();
  Map<GroupPrincipal, List<Principal>> groupDefinitions =
      groups.getGroupDefinitions();
  assertEquals(Lists.newArrayList(newUserPrincipal("user1")),
      groupDefinitions.get(newGroupPrincipal("group1")));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:26,代码来源:OpentextAdaptorTest.java


示例10: testGetGroupsLoginDisabledUser

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGetGroupsLoginDisabledUser() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  Member active = getMember(1, "user1", "User");
  User disabled = (User) getMember(2, "user2", "User");
  MemberPrivileges memberPrivileges = disabled.getPrivileges();
  memberPrivileges.setLoginEnabled(false);
  Member group = getMember(11, "group1", "Group");
  soapFactory.memberServiceMock.addMember(active);
  soapFactory.memberServiceMock.addMember(disabled);
  soapFactory.memberServiceMock.addMember(group);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), active);
  soapFactory.memberServiceMock.addMemberToGroup(group.getID(), disabled);

  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);
  OpentextAdaptor.Groups groups =
      adaptor.new Groups(soapFactory.newMemberService());
  groups.addGroups();
  Map<GroupPrincipal, List<Principal>> groupDefinitions =
      groups.getGroupDefinitions();
  assertEquals(Lists.newArrayList(newUserPrincipal("user1")),
      groupDefinitions.get(newGroupPrincipal("group1")));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:27,代码来源:OpentextAdaptorTest.java


示例11: testGetGroupPrincipal

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGetGroupPrincipal() throws InterruptedException {
  SoapFactoryMock soapFactory = new SoapFactoryMock();
  Member testMember = new Member();
  OpentextAdaptor adaptor = new OpentextAdaptor(soapFactory);
  AdaptorContext context = ProxyAdaptorContext.getInstance();
  Config config = initConfig(adaptor, context);
  adaptor.init(context);

  // unqualified name
  testMember.setName("group1");
  assertEquals(new GroupPrincipal("group1", LOCAL_NAMESPACE),
      adaptor.getGroupPrincipal(testMember));

  // qualified name
  testMember.setName("windowsDomain\\group1");
  assertEquals(
      new GroupPrincipal("windowsDomain\\group1", GLOBAL_NAMESPACE),
      adaptor.getGroupPrincipal(testMember));
}
 
开发者ID:googlegsa,项目名称:opentext,代码行数:21,代码来源:OpentextAdaptorTest.java


示例12: getDocIdsSiteCollectionOnly

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
private void getDocIdsSiteCollectionOnly(DocIdPusher pusher)
    throws InterruptedException,IOException {
  log.entering("SharePointAdaptor", "getDocIdsSiteCollectionOnly", pusher);
  SiteAdaptor scAdaptor = getSiteAdaptor(sharePointUrl.getSharePointUrl(), 
      sharePointUrl.getSharePointUrl());
  SiteDataClient scClient = scAdaptor.getSiteDataClient();
  Site site = scClient.getContentSite();
  String siteCollectionUrl = getCanonicalUrl(site.getMetadata().getURL());
  // Reset site collection URL instance to use correct URL.
  scAdaptor = getSiteAdaptor(siteCollectionUrl, siteCollectionUrl);
  DocId siteCollectionDocId = scAdaptor.encodeDocId(siteCollectionUrl);
  pusher.pushDocIds(Arrays.asList(siteCollectionDocId));
  Map<GroupPrincipal, Collection<Principal>> groupDefs 
      = new HashMap<GroupPrincipal, Collection<Principal>>();
  groupDefs.putAll(scAdaptor.computeMembersForGroups(site.getGroups()));
  String siteId = site.getMetadata().getID();
  sitePushGroupDefinitions(siteId, pusher, groupDefs);
  log.exiting("SharePointAdaptor", "getDocIdsSiteCollectionOnly");
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:20,代码来源:SharePointAdaptor.java


示例13: testGetGroupUpdatesMidGroupException

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGetGroupUpdatesMidGroupException() throws Exception {
  insertUsers("User0", "User1", "User2");
  String dateStr = getNowPlusMinutes(5);
  insertModifiedGroup(dateStr, "Group0", "User0");
  insertModifiedGroup(dateStr, "Group1", "User1", "User2");
  insertModifiedGroup(dateStr, "Group2", "User2");

  testGetGroupUpdatesExceptions(Iterators.forArray(2, -1),
      NO_EXCEPTION,
      ImmutableMap.of(new GroupPrincipal("Group0", "NS_Local"),
          ImmutableSet.of(new UserPrincipal("User0", "NS")),
          new GroupPrincipal("Group1", "NS_Local"),
          ImmutableSet.of(new UserPrincipal("User1", "NS"),
              new UserPrincipal("User2", "NS")),
          new GroupPrincipal("Group2", "NS_Local"),
          ImmutableSet.of(new UserPrincipal("User2", "NS"))),
      new Checkpoint(dateStr, GROUP.pad("Group2")));
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:20,代码来源:DocumentumAdaptorTest.java


示例14: retrieveMemberIdMapping

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
private MemberIdMapping retrieveMemberIdMapping() throws IOException {
  log.entering("SiteAdaptor", "retrieveMemberIdMapping");
  Site site = siteDataClient.getContentSite();
  Map<Integer, Principal> map = new HashMap<Integer, Principal>();
  for (GroupMembership.Group group : site.getGroups().getGroup()) {
    map.put(group.getGroup().getID(), new GroupPrincipal(
        group.getGroup().getName(),
        defaultNamespace + "_" + site.getMetadata().getURL()));
  }
  for (UserDescription user : site.getWeb().getUsers().getUser()) {
    Principal principal = userDescriptionToPrincipal(user);
    if (principal == null) {
      log.log(Level.WARNING,
          "Unable to determine login name. Skipping user with ID {0}",
          user.getID());
      continue;
    }
    map.put(user.getID(), principal);
  }
  MemberIdMapping mapping = new MemberIdMapping(map);
  log.exiting("SiteAdaptor", "retrieveMemberIdMapping", mapping);
  return mapping;
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:24,代码来源:SharePointAdaptor.java


示例15: computeMembersForGroups

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
private Map<GroupPrincipal, Collection<Principal>> computeMembersForGroups(
    GroupMembership groups) {
  Map<GroupPrincipal, Collection<Principal>> defs
      = new HashMap<GroupPrincipal, Collection<Principal>>();
  for (GroupMembership.Group group : groups.getGroup()) {
    GroupPrincipal groupPrincipal = new GroupPrincipal(
        group.getGroup().getName(), defaultNamespace + "_" + siteUrl);
    Collection<Principal> members = new LinkedList<Principal>();
    // We always provide membership details, even for empty groups.
    defs.put(groupPrincipal, members);
    if (group.getUsers() == null) {
      continue;
    }
    for (UserDescription user : group.getUsers().getUser()) {
      Principal principal = userDescriptionToPrincipal(user);
      if (principal == null) {
        log.log(Level.WARNING,
            "Unable to determine login name. Skipping user with ID {0}",
            user.getID());
        continue;
      }
      members.add(principal);
    }
  }
  return defs;
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:27,代码来源:SharePointAdaptor.java


示例16: testModifiedGetDocIdsClient

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testModifiedGetDocIdsClient() throws Exception {
  final String getChangesContentDatabase
      = loadTestString("testModifiedGetDocIdsClient.changes-cd.xml");
  adaptor = new SharePointAdaptor(initableSoapFactory,
      new UnsupportedHttpClient(), executorFactory,
      new MockAuthenticationClientFactoryForms(),
      new UnsupportedActiveDirectoryClientFactory());
  adaptor.init(new MockAdaptorContext(config, pusher));
  SPContentDatabase result = parseChanges(getChangesContentDatabase);
  List<DocId> docIds = new ArrayList<DocId>();
  Map<GroupPrincipal, Collection<Principal>> groupDefs
      = new HashMap<GroupPrincipal, Collection<Principal>>();
  Set<String> updatedSiteSecurity = new HashSet<String>();
  adaptor.getModifiedDocIdsContentDatabase(
      result, docIds, updatedSiteSecurity);    
  assertEquals(Arrays.asList(
        new DocId("http://localhost:1/Lists/Announcements/2_.000")),
      docIds);
  assertEquals(Collections.emptyMap(), groupDefs);
}
 
开发者ID:googlegsa,项目名称:sharepoint,代码行数:22,代码来源:SharePointAdaptorTest.java


示例17: pushCollection

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Override
protected Checkpoint pushCollection(DocIdPusher pusher)
    throws InterruptedException {
  FeedType feedType;
  if ((queryBatchSize > 0) || caughtException || prevError) {
    feedType = FeedType.INCREMENTAL;
  } else {
    feedType = this.feedType;
  }

  Map<GroupPrincipal, Collection<Principal>> groupDefs = groups.build();
  pusher.pushGroupDefinitions(groupDefs,
      caseSensitivityType == CaseSensitivityType.EVERYTHING_CASE_SENSITIVE,
      feedType, null, null);
  // If we caught an exception, then the next push will also be incomplete,
  // else (modulo batching) we finished sending all the groups, and the
  // next push can be full again.
  prevError = caughtException;
  return groupsCheckpoint;
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:21,代码来源:DocumentumAdaptor.java


示例18: addGroup

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
/** Adds a group and its members to the collection of groups. */
private void addGroup(String groupName,
    ImmutableMap.Builder<GroupPrincipal, Collection<Principal>> groupsBuilder,
    ImmutableSet.Builder<Principal> membersBuilder, Principals principals)
    throws DfException {
  if (membersBuilder == null) {
    return;
  }
  GroupPrincipal groupPrincipal = (GroupPrincipal)
      principals.getPrincipal(groupName, true);
  if (groupPrincipal == null) {
    return;
  }
  ImmutableSet<Principal> members = membersBuilder.build();
  groupsBuilder.put(groupPrincipal, members);
  logger.log(Level.FINEST, "Pushing Group {0}: {1}",
      new Object[] { groupPrincipal.getName(), members });
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:19,代码来源:DocumentumAdaptor.java


示例19: testGroupAcls

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGroupAcls() throws Exception {
  insertUsers("User1", "User2");
  insertGroup("Group1", "User2", "User3");
  insertGroup("Group2", "User4", "User5");
  insertGroup("Group3", "User6", "User7");
  String id = "4501081f80000101";
  createAcl(id);
  addAllowPermitToAcl(id, "User1", IDfACL.DF_PERMIT_WRITE);
  addAllowPermitToAcl(id, "User2", IDfACL.DF_PERMIT_READ);
  addAllowPermitToAcl(id, "Group1", IDfACL.DF_PERMIT_READ);
  addAllowPermitToAcl(id, "Group2", IDfACL.DF_PERMIT_WRITE);
  addDenyPermitToAcl(id, "Group3", IDfACL.DF_PERMIT_READ);

  Map<DocId, Acl> namedResources = getAllAcls();
  Acl acl = namedResources.get(new DocId(id));
  assertEquals(ImmutableSet.of(new GroupPrincipal("Group1", "NS_Local"),
      new GroupPrincipal("Group2", "NS_Local")),
      acl.getPermitGroups());
  assertEquals(ImmutableSet.of(new GroupPrincipal("Group3", "NS_Local")),
      acl.getDenyGroups());
  assertEquals(ImmutableSet.of(new UserPrincipal("User1", "NS"),
      new UserPrincipal("User2", "NS")),
      acl.getPermitUsers());
  assertEquals(ImmutableSet.of(), acl.getDenyUsers());
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:27,代码来源:DocumentumAdaptorTest.java


示例20: testGroupDmWorldAcl

import com.google.enterprise.adaptor.GroupPrincipal; //导入依赖的package包/类
@Test
public void testGroupDmWorldAcl() throws Exception {
  insertUsers("User1", "User3");
  insertGroup("Group1", "User2", "User3");
  String id = "4501081f80000102";
  createAcl(id);
  addAllowPermitToAcl(id, "Group1", IDfACL.DF_PERMIT_BROWSE);
  addAllowPermitToAcl(id, "dm_world", IDfACL.DF_PERMIT_READ);
  addDenyPermitToAcl(id, "User1", IDfACL.DF_PERMIT_READ);
  addDenyPermitToAcl(id, "User3", IDfACL.DF_PERMIT_WRITE);

  Map<DocId, Acl> namedResources = getAllAcls();
  Acl acl = namedResources.get(new DocId(id));
  assertEquals(ImmutableSet.of(new GroupPrincipal("dm_world", "NS_Local")),
      acl.getPermitGroups());
  assertEquals(ImmutableSet.of(), acl.getDenyGroups());
  assertEquals(ImmutableSet.of(), acl.getPermitUsers());
  assertEquals(ImmutableSet.of(new UserPrincipal("User1", "NS")),
      acl.getDenyUsers());
}
 
开发者ID:googlegsa,项目名称:documentum,代码行数:21,代码来源:DocumentumAdaptorTest.java



注:本文中的com.google.enterprise.adaptor.GroupPrincipal类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XpandFacade类代码示例发布时间:2022-05-22
下一篇:
Java FilterTranslator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap