Package org.jasig.portal.groups

Examples of org.jasig.portal.groups.IGroupMember


          IEntityGroup group = getGroup(groupKey);
          EntityIdentifier ei = p.getEntityIdentifier();
         
          try
          {
              IGroupMember groupMember = GroupService.getGroupMember(ei);
              boolean isMember =false;
             
              if (evaluatorMode == MEMBER_OF_MODE)
              {
                  isMember = groupMember.isMemberOf(group);
              }
              else
              {
                  isMember = groupMember.isDeepMemberOf(group);
              }
              return isMember;
          } catch (GroupsException e)
          {
              throw new RuntimeException("Unable to determine if user "
View Full Code Here


        containingGroups = (Set<String>) this.entityParentsCache.get(target);

        if (containingGroups == null) {

          containingGroups = new HashSet<String>();
          IGroupMember targetEntity = GroupService.findGroup(target);
        if (targetEntity == null) {
          if (target.startsWith(IPermission.CHANNEL_PREFIX)) {
            targetEntity = GroupService.getGroupMember(target.replace(IPermission.CHANNEL_PREFIX, ""), IChannelDefinition.class);
          } else {
            targetEntity = GroupService.getGroupMember(target, IPerson.class);
          }
        }
       
        if (targetEntity != null) {
          for (Iterator containing = targetEntity.getAllContainingGroups(); containing.hasNext();) {
            containingGroups.add(((IEntityGroup)containing.next()).getKey());
          }
        }
       
        this.entityParentsCache.put(target, containingGroups);
View Full Code Here

    String msg = null;
    String is = null, startsWith = null, endsWith = null, contains = null, badQuery = null;
    Class type = IPERSON_CLASS;
    IEntityGroup existingGroup = null;
    IGroupMember member = null;
    EntityIdentifier[] ids = null;

    msg = "Searching for existing groups...";
    print(msg);
    for ( int i=0; i<testFileNames.length; i++ )
    {
        is = testFileNames[i];
        startsWith = is.substring(0, (is.length() - 1) );
        endsWith = is.substring(1);
        contains = is.substring(1, (is.length() - 1));
        badQuery = is + " a b c";

        msg = "Searching for IS " + is;
        ids = getGroupStore().searchForGroups(is, IGroupConstants.IS, type);
        assertEquals(msg, ids.length, 1);
        member = findGroup(ids[0].getKey());
        assertTrue(msg, member.isGroup());

        msg = "Searching for STARTS WITH " + startsWith;
        ids = getGroupStore().searchForGroups(startsWith, IGroupConstants.STARTS_WITH, type);
        assertTrue(msg, ids.length > 0);
View Full Code Here

      }
  }

  protected void updateUser(int userId, IPerson person, TemplateUser templateUser) throws Exception {
      // Remove my existing group memberships
      IGroupMember me = GroupService.getGroupMember(person.getEntityIdentifier());
      Iterator myExistingGroups = me.getContainingGroups();
      while (myExistingGroups.hasNext()) {
          IEntityGroup eg = (IEntityGroup)myExistingGroups.next();
          ILockableEntityGroup leg = getSafeLockableGroup(eg, me);
          if (leg != null) {
              removePersonFromGroup(person, me, leg);
          }
      }

      // Copy template user's groups memberships
      IGroupMember template = GroupService.getEntity(templateUser.getUserName(), Class.forName("org.jasig.portal.security.IPerson"));
      Iterator templateGroups = template.getContainingGroups();
      while (templateGroups.hasNext()) {
          IEntityGroup eg = (IEntityGroup)templateGroups.next();
          ILockableEntityGroup leg = getSafeLockableGroup(eg, me);
          if (leg != null) {
              addPersonToGroup(person, me, leg);
View Full Code Here

      return;
  }

  protected int addNewUser(int newUID, IPerson person, TemplateUser templateUser) throws Exception {
      // Copy template user's groups memberships
      IGroupMember me = GroupService.getGroupMember(person.getEntityIdentifier());
      IGroupMember template = GroupService.getEntity(templateUser.getUserName(), Class.forName("org.jasig.portal.security.IPerson"));
      Iterator templateGroups = template.getContainingGroups();
      while (templateGroups.hasNext()) {
          IEntityGroup eg = (IEntityGroup)templateGroups.next();
          ILockableEntityGroup leg = getSafeLockableGroup(eg, me);
          if (leg != null) {
              addPersonToGroup(person, me, leg);
View Full Code Here

    String nonExistingTarget = "CHAN_ID.9999";
    String everyoneKey = "local" + GROUP_SEPARATOR + "0";

    msg = "Creating a group member for everyone (" + EVERYONE_GROUP_PRINCIPAL_KEY + ").";
    print(msg);
    IGroupMember everyone = GroupService.getGroupMember(EVERYONE_GROUP_KEY, GROUP_CLASS);
    assertNotNull(msg, everyone);

    msg = "Getting principal for " + everyone;
    print(msg);
    IAuthorizationPrincipal prin = getService().newPrincipal(everyone);
View Full Code Here

    String msg = null;
    String is = null, startsWith = null, endsWith = null, contains = null, badQuery = null;
    Class type = IPERSON_CLASS;
    IEntityGroup existingGroup = null;
    IGroupMember member = null;
    EntityIdentifier[] ids = null;

    msg = "Searching for existing groups...";
    print(msg);
    for ( int i=0; i<testFileNames.length; i++ )
    {
        is = testFileNames[i];
        startsWith = is.substring(0, (is.length() - 1) );
        endsWith = is.substring(1);
        contains = is.substring(1, (is.length() - 1));
        badQuery = is + " a b c";

        msg = "Searching for IS " + is;
        ids = getGroupStore().searchForGroups(is, IGroupConstants.IS, type);
        assertEquals(msg, ids.length, 1);
        member = findGroup(ids[0].getKey());
        assertTrue(msg, member.isGroup());

        msg = "Searching for STARTS WITH " + startsWith;
        ids = getGroupStore().searchForGroups(startsWith, IGroupConstants.STARTS_WITH, type);
        assertTrue(msg, ids.length > 0);
View Full Code Here

  private static void processGroupsRecursively(IEntityGroup group,
    Document owner, Element parentGroup) throws Exception {
    Date now = new Date();
    Iterator iter = group.getMembers();
    while (iter.hasNext()) {
      IGroupMember member = (IGroupMember)iter.next();
      if (member.isGroup()) {
        IEntityGroup memberGroup = (IEntityGroup)member;
        String key = memberGroup.getKey();
        String name = memberGroup.getName();
        String description = memberGroup.getDescription();
View Full Code Here

                    categoryServant = CGroupsManagerServantFactory.getGroupsServantforSelection(staticData,
                            "Please select channel categories for this channel:",
                            GroupService.CHANNEL_CATEGORIES, false, false);
                }
                else {
                    IGroupMember thisChan = GroupService.getEntity(channelDef.ID.substring(4),
                            Class.forName(GroupService.CHANNEL_CATEGORIES));
                    categoryServant = CGroupsManagerServantFactory.getGroupsServantforGroupMemberships(this.staticData,
                            "Please select channel categories for this channel:",
                            thisChan, false);
                }
View Full Code Here

    String parentKey = String.valueOf(parent.getId());
    IEntityGroup parentGroup = GroupService.findGroup(parentKey);
    List categories = new ArrayList();
    Iterator iter = parentGroup.getMembers();
    while (iter.hasNext()) {
      IGroupMember gm = (IGroupMember)iter.next();
      if (gm.isGroup()) {
        String categoryId = gm.getKey();
        categories.add(getChannelCategory(categoryId));
      }
    }
    return (ChannelCategory[])categories.toArray(new ChannelCategory[0]);
  }
View Full Code Here

TOP

Related Classes of org.jasig.portal.groups.IGroupMember

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.