Examples of IPersonAttributes


Examples of org.jasig.services.persondir.IPersonAttributes

            // Populate the person object using the PersonDirectory if applicable
            if (PropertiesManager.getPropertyAsBoolean("org.jasig.portal.services.Authentication.usePersonDirectory")) {
                // Retrieve all of the attributes associated with the person logging in
                final String username = person.getUserName();

                final IPersonAttributes personAttributes = this.personAttributeDao.getPerson(username);

                if (personAttributes != null) {
                    // attribs may be null.  IPersonAttributeDao returns null when it does not recognize a user at all, as
                    // distinguished from returning an empty Map of attributes when it recognizes a user has having no
                    // attributes.

                    person.setAttributes(personAttributes.getAttributes());
                }

            }
            // Make sure the the user's fullname is set
            if (person.getFullName() == null) {
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

        List<IPersonAttributes> list = new ArrayList<IPersonAttributes>();
        for (IPersonAttributes person : people) {
            // if the current user has permission to view this person, construct
            // a new representation of the person limited to attributes the
            // searcher has permissions to view
            final IPersonAttributes visiblePerson = getVisiblePerson(principal, person, permittedAttributes);
            if (visiblePerson != null) {
                list.add(visiblePerson);
            }
        }
       
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

        // build a set of all possible user attributes the current user has
        // permission to view
        final Set<String> permittedAttributes = getAvailableAttributes(principal);
       
        // get the set of people matching the search query
        final IPersonAttributes person = this.personAttributeDao.getPerson(username);
       
        if (person == null) {
            logger.info("No user found with username matching " + username);
            return null;
        }
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

                }
            }
           
            // use the filtered attribute list to create and return a new
            // person object
            final IPersonAttributes visiblePerson = new NamedPersonImpl(person.getName(), visibleAttributes);
            return visiblePerson;
           
        } else {
            logger.debug("Principal " + principal.getKey() + " does not have permissions to view user " + person.getName());
            return null;
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

        if (searcher == null) {
            response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
            return null;
        }

        final IPersonAttributes person = lookupHelper.findPerson(searcher, username);

        final ModelAndView mv = new ModelAndView();
        mv.addObject("person", person);
        mv.setViewName("json");
       
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

         if (member.getEntityType() != IPERSON_CLASS)
             { return false; }
         IPerson person = null;
         try {
             IPersonAttributeDao pa = PersonAttributeDaoLocator.getPersonAttributeDao();
             final IPersonAttributes personAttributes = pa.getPerson(member.getKey());

             RestrictedPerson rp = PersonFactory.createRestrictedPerson();
             if (personAttributes != null) {
                 rp.setAttributes(personAttributes.getAttributes());
             }
            
             person = rp;
         }
         catch (Exception ex) {
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

     * @return A Map of user attributes for the user and windows
     * @throws PortletContainerException
     */
    protected Map<String, String> getUserInfo(String remoteUser, HttpServletRequest httpServletRequest, IPortletWindow portletWindow) throws PortletContainerException {
        //Get the list of user attributes the portal knows about the user
        final IPersonAttributes personAttributes = this.personAttributeDao.getPerson(remoteUser);
        if (personAttributes == null) {
            return Collections.emptyMap();
        }
        final List<? extends UserAttribute> expectedUserAttributes = this.getExpectedUserAttributes(httpServletRequest, portletWindow);
       
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

           if (member.getEntityType() != IPERSON_CLASS)
               { return false; }
           IPerson person = null;
           try {
               IPersonAttributeDao pa = PersonAttributeDaoLocator.getPersonAttributeDao();
               final IPersonAttributes personAttributes = pa.getPerson(member.getKey());

               RestrictedPerson rp = PersonFactory.createRestrictedPerson();
               if (personAttributes != null) {
                   rp.setAttributes(personAttributes.getAttributes());
               }
              
               person = rp;
           }
           catch (Exception ex) {
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

   * @param remoteUser
   * @param expectedUserAttributes
   * @return an unmodifiable map containing the multi-valued attributes for the user within the list of expected attributes
   */
  protected Map<String, List<Object>> getMultiValuedUserInfoMap(String remoteUser, List<? extends UserAttribute> expectedUserAttributes) {
    final IPersonAttributes personAttributes = this.personAttributeDao.getPerson(remoteUser);
    if (personAttributes == null) {
      return Collections.emptyMap();
    }

    final Map<String, List<Object>> resultUserInfoMap = new HashMap<String, List<Object>>(expectedUserAttributes.size());

    //Copy expected attributes to the USER_INFO Map
    final Map<String, List<Object>> attributes = personAttributes.getAttributes();
    for (final UserAttribute userAttributeDD : expectedUserAttributes) {
      final String userAttributeName = userAttributeDD.getName();

      //containsKey check to handle attributes with a single null value
      if (attributes.containsKey(userAttributeName)) {
View Full Code Here

Examples of org.jasig.services.persondir.IPersonAttributes

        }

        //Map the attributes of the found people according to resultAttributeMapping if it is set
        final Set<IPersonAttributes> mappedPeople = new LinkedHashSet<IPersonAttributes>();
        for (final ILocalAccountPerson unmappedPerson : unmappedPeople) {
            final IPersonAttributes mappedPerson = this.mapPersonAttributes(unmappedPerson);
            mappedPeople.add(mappedPerson);
        }
       
        return Collections.unmodifiableSet(mappedPeople);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.