Package org.jasig.portal.groups

Examples of org.jasig.portal.groups.IGroupMember


  public String getProperty(EntityIdentifier entityID, String name) {
    String r = null;
    try{
      StringBuffer buf = new StringBuffer();
      if (name.equals(names[0])){
        IGroupMember gm = GroupService.getGroupMember(entityID);
        Iterator i = gm.getContainingGroups();
        int x = 0;
        while (i.hasNext()){
          if (x > 0){
            buf.append(", ");
          }
View Full Code Here


      identifierType = entityEnum.getClazz();
    }
   
    for(int i=0;i<identifiers.length;i++) {
      if(identifiers[i].getType().equals(identifierType)) {
        IGroupMember entity = GroupService.getGroupMember(identifiers[i]);
        if(entity instanceof IEntityGroup) {
          /* Don't look up the children for a search. */
          JsonEntityBean jsonBean = new JsonEntityBean((IEntityGroup) entity, getEntityType(entity));
          results.add(jsonBean);
        } else {
View Full Code Here

      }
    }
   
    // otherwise use the getGroupMember method
    else {
      IGroupMember entity = GroupService.getGroupMember(entityId, entityEnum.getClazz());
      if(entity == null || entity instanceof IEntityGroup) {
        return null;
      }
      JsonEntityBean jsonBean = new JsonEntityBean(entity, entityEnum.toString());
     
View Full Code Here

   */
  private JsonEntityBean populateChildren(JsonEntityBean jsonBean, Iterator<IGroupMember> children) {
   
    while(children.hasNext()) {
     
      IGroupMember member = children.next();
     
      // get the type of this member entity
      String entityType = getEntityType(member);
      EntityEnum entityEnum = EntityEnum.getEntityEnum(entityType);
     
View Full Code Here

       
        if (results.length > 1) {
            this.logger.warn(results.length + " groups were found for '" + groupName + "'. The first result will be used.");
        }
           
        final IGroupMember group = GroupService.getGroupMember(results[0]);
       
        final IEntity entity = GroupService.getEntity(userName, IPerson.class);
        if (entity == null) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("No user found for key '" + userName + "'");
            }
           
            return false;
        }
       
        return group.deepContains(entity);
    }
View Full Code Here

      if (log.isTraceEnabled()) {
        log.trace("Searching for unblocked path to GRANT for principal [" + principal + "] to [" + activity + "] on target [" + target + "] having already checked ["+ seenGroups + "]");
      }
     
        IGroupMember principalAsGroupMember = service.getGroupMember(principal);

        if (seenGroups.contains(principalAsGroupMember)) {
         
          if (log.isTraceEnabled()) {
            log.trace("Declining to re-examine principal [" + principal + "] for permission to [" + activity + "] on [" + target + "] because this group is among already checked groups [" + seenGroups + "]");
          }
         
            return false;
        }

        seenGroups.add(principalAsGroupMember);



        Iterator<IGroupMember> immediatelyContainingGroups = principalAsGroupMember.getContainingGroups();

        while (immediatelyContainingGroups.hasNext()) {
            IGroupMember parentGroup = immediatelyContainingGroups.next();
            try {
                if (parentGroup != null) {
                    IAuthorizationPrincipal parentPrincipal = service.newPrincipal( parentGroup );
                    IPermission[] parentPermissions = service.getPermissionsForPrincipal(parentPrincipal, owner, activity, target);
View Full Code Here

    /**
     * Sets the {@link StatsSession#setGroups(Set)} using the keys from the {@link IGroupMember}s returned by
     * {@link IGroupMember#getAllContainingGroups()}
     */
    protected void updateStatsSessionGroups(final StatsSession session, final IPerson person) throws GroupsException {
        final IGroupMember member = GroupService.getGroupMember(person.getEntityIdentifier());
       
        final Set<String> groupKeys = new HashSet<String>();
        for (final Iterator<IGroupMember> groupItr = member.getAllContainingGroups(); groupItr.hasNext(); ) {
            final IGroupMember group = groupItr.next();
            groupKeys.add(group.getKey());
        }
       
        session.setGroups(groupKeys);
    }
View Full Code Here

        if (isUserInRole) {
            return true;
        }
       
        //Find the group for the role, if not found return false
        IGroupMember groupForRole = GroupService.findGroup(role);
        if (groupForRole == null) {
            final EntityIdentifier[] results = GroupService.searchForGroups(role, GroupService.IS, IPerson.class);
            if (results == null || results.length == 0) {
                return false;
            }
           
            if (results.length > 1) {
                this.logger.warn(results.length + " groups were found for role '" + role + "'. The first result will be used.");
            }
           
            groupForRole = GroupService.getGroupMember(results[0]);
        }

        //Load the group information about the current user
        final IUserInstance userInstance = this.userInstanceManager.getUserInstance(this.getWrappedRequest());
        final IPerson person = userInstance.getPerson();
        final EntityIdentifier personEntityId = person.getEntityIdentifier();
        final IGroupMember personGroupMember = GroupService.getGroupMember(personEntityId);
       
        return personGroupMember.isDeepMemberOf(groupForRole);
    }
View Full Code Here

*/
private IGroupMember getGroupMemberForPrincipal(IAuthorizationPrincipal principal)
throws GroupsException
{

    IGroupMember gm = GroupService.getGroupMember(principal.getKey(), principal.getType());

    if (log.isDebugEnabled()) {
        log.debug("AuthorizationImpl.getGroupMemberForPrincipal(): principal [" + principal + "] " +
                "got group member [" + gm + "]");
    }
View Full Code Here

* @return java.util.Iterator over Collection of IEntityGroups
*/
private Iterator getGroupsForPrincipal(IAuthorizationPrincipal principal)
throws GroupsException
{
    IGroupMember gm = getGroupMemberForPrincipal(principal);
    return gm.getAllContainingGroups();
}
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.