Package org.jasig.portal.groups

Examples of org.jasig.portal.groups.IGroupMember


    protected void populateMembers(ArrayList gmembers, IAuthorizationPrincipal[] aps){
      if (log.isDebugEnabled())
          log.debug("PermissionsManager.PopulateMembers(): checking principal set of size"+aps.length);
      for (int a = 0; a< aps.length ; a++){
        try {
          IGroupMember agm = AuthorizationService.instance().getGroupMember(aps[a]);
          if (log.isDebugEnabled())
              log.debug("PermissionsManager.PopulateMembers(): checking whether "+
                      agm.getType()+"."+agm.getKey()+" needs to be added");
          if (!gmembers.contains(agm)){
            gmembers.add(agm);
          }
        }
        catch(Exception e){
View Full Code Here


        log.debug("PermissionsManager - Getting servant results");
        Object[] results = session.servant.getResults();
        if (results != null && results.length > 0) {
            IAuthorizationPrincipal[] iap = new IAuthorizationPrincipal[results.length];
            for (int i = 0; i< results.length ; i++){
              IGroupMember gm = (IGroupMember) results[i];
              iap[i] = AuthorizationService.instance().newPrincipal(gm);
            }
            session.principals=iap;
            log.debug("PermissionsManager - Getting rid of Servant");
            session.servant=null;
View Full Code Here

    public void setStaticData (org.jasig.portal.ChannelStaticData sD) {
        this.session = new PermissionsSessionData();
        session.staticData = sD;
        try {
            IEntityGroup admin = GroupService.getDistinguishedGroup(GroupService.PORTAL_ADMINISTRATORS);
            IGroupMember me = AuthorizationService.instance().getGroupMember(session.staticData.getAuthorizationPrincipal());
            if (admin.deepContains(me)) {
                session.isAuthorized = true;
            }
        } catch (Exception e) {
            log.error(e, e);
View Full Code Here

      sr.setName("Search Results");
      sr.setDescription("Search for a " + label + " whose name" + methods[methodInt] + "'" + query + "'");
      sr.setCreatorID("CGroupsManager");
      for (int sub = 0; sub < results.length; sub++) {
         EntityIdentifier entID = results[sub];
         IGroupMember resultGroup = GroupService.getGroupMember(entID);
         sr.addMember(resultGroup);
      }
      Element searchElem = GroupsManagerXML.getGroupMemberXml(sr, true, null, sessionData.getUnrestrictedData());
      searchElem.setAttribute("searchResults", "true");
      model.getDocumentElement().appendChild(searchElem);
View Full Code Here

         Element elem = (org.w3c.dom.Element)nList.item(i);
         if (Utility.areEqual(elem.getAttribute("selected"), "true")) {
            addit = true;
            Iterator gmItr = gmCollection.iterator();
            while (gmItr.hasNext()) {
               IGroupMember ggmm = (IGroupMember)gmItr.next();
               if ((ggmm.getKey().equals(elem.getAttribute("key")))
                        && (ggmm.getType().equals(elem.getAttribute("type")))){
                       addit = false;
                       break;
               }
            }
            if (addit) {
               IGroupMember gm = Utility.retrieveGroupMemberForKeyAndType(elem.getAttribute("key"),elem.getAttribute("type"));
               gmCollection.add(gm);
               Utility.logMessage("DEBUG", "DoneWithSelection::addGroupMemberToCollection(): " +
                     "- adding group member" + elem.getAttribute("key"));
            }
         }
View Full Code Here

   private void addChildrenToGroup (Vector gmCollection, CGroupsManagerSessionData sessionData,
      Element parentElem, Document model) throws Exception {
      //ChannelRuntimeData runtimeData = sessionData.runtimeData;
      Element parent;
      ILockableEntityGroup parentGroup = null;
      IGroupMember childGm = null;
      Element childElem;
      parentGroup = sessionData.lockedGroup;
      Iterator gmItr = gmCollection.iterator();
      while (gmItr.hasNext()) {
         childGm = (IGroupMember) gmItr.next();
View Full Code Here

      ChannelRuntimeData runtimeData= sessionData.runtimeData;
      Document model = getXmlDoc(sessionData);
      Utility.logMessage("DEBUG", "AddMembers::execute(): Start");
      String parentAddElemId = getCommandArg(runtimeData);

      IGroupMember pg = GroupsManagerXML.retrieveGroupMemberForElementId(model, parentAddElemId);
      sessionData.rootViewGroupID = Utility.translateKeytoID(GroupService.getRootGroup(pg.getLeafType()).getKey(),sessionData.getUnrestrictedData());
      // Parent was locked so no other thread or process could have changed it, but
      // child members could have changed.
      Element parentElem = GroupsManagerXML.getElementById(model, parentAddElemId);
      GroupsManagerXML.refreshAllNodesRecursivelyIfRequired(sessionData.getUnrestrictedData(), parentElem);
      sessionData.returnToMode = sessionData.mode;
View Full Code Here

        }

        final List<IGroupMember> groups = new ArrayList<IGroupMember>();
        for (String groupName : portletRep.getGroups()) {
            EntityIdentifier[] gs = GroupService.searchForGroups(groupName, IGroupConstants.IS, IPerson.class);
            IGroupMember group;
            if (gs != null && gs.length > 0) {
                group = GroupService.findGroup(gs[0].getKey());
            } else {
                // An actual group key might be specified, so try looking up group directly
                group = GroupService.findGroup(groupName);
View Full Code Here

            portletPreferenceList.add(externalPortletPreference);
        }
        Collections.sort(portletPreferenceList, ExternalPortletPreferenceNameComparator.INSTANCE);
        
        final List<String> categoryList = rep.getCategories();
        final IGroupMember gm = GroupService.getGroupMember(def.getPortletDefinitionId().getStringId(), IPortletDefinition.class);
        @SuppressWarnings("unchecked")
        final Iterator<IEntityGroup> categories = GroupService.getCompositeGroupService().findContainingGroups(gm);
        while (categories.hasNext()) {
            IEntityGroup category = categories.next();
            categoryList.add(category.getName());
        }
        Collections.sort(categoryList);
       
        
        
        final List<String> groupList = rep.getGroups();
        final List<String> userList = rep.getUsers();
       
        final AuthorizationService authService = org.jasig.portal.services.AuthorizationService.instance();
        final IPermissionManager pm = authService.newPermissionManager("UP_PORTLET_SUBSCRIBE");
        final String portletTargetId = PermissionHelper.permissionTargetIdForPortletDefinition(def);
        final IAuthorizationPrincipal[] principals = pm.getAuthorizedPrincipals("SUBSCRIBE", portletTargetId);
        
        for (IAuthorizationPrincipal principal : principals) {
            IGroupMember member = authService.getGroupMember(principal);
            if (member.isGroup()) {
                final EntityNameFinderService entityNameFinderService = EntityNameFinderService.instance();
                final IEntityNameFinder nameFinder = entityNameFinderService.getNameFinder(member.getType());
                try {
                    groupList.add(nameFinder.getName(member.getKey()));
                }
                catch (Exception e) {
                    throw new RuntimeException("Could not find group name for entity: " + member.getKey(), e);
                }
            } else {
                userList.add(member.getKey());
            }
        }
       
        Collections.sort(groupList);
        Collections.sort(userList);
View Full Code Here

                  }

                  // if a matching group can't be found, try to find a matching
                  // non-group entity
                  else {
                      IGroupMember member = AuthorizationService.instance().getGroupMember(prins[mp]);
                      bean = new JsonEntityBean(member, EntityEnum.PERSON);
                      String name = groupListHelper.lookupEntityName(bean);
                      bean.setName(name);
                  }
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.