Package org.jasig.portal.security

Examples of org.jasig.portal.security.IPerson


            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


    HttpSession session = request.getSession(false);

    if (session != null) {
        // Record that an authenticated user is requesting to log out
        try {
            IPerson person = PersonManagerFactory.getPersonManagerInstance().getPerson(request);
            if (person != null && person.getSecurityContext().isAuthenticated()) {
              EventPublisherLocator.getApplicationEventPublisher().publishEvent(new UserLoggedOutPortalEvent(this, person));
            }
        } catch (Exception e) {
            log.error("Exception recording logout " +
                    "associated with request " + request, e);
View Full Code Here

   * @return String representing the redirection URL
   */
   private String getRedirectionUrl (HttpServletRequest request) {
      String redirect = null;
      String defaultRedirect = request.getContextPath() + '/' + DEFAULT_REDIRECT;
      IPerson person = null;
      if (REDIRECT_MAP == null) {
         return  defaultRedirect;
      }
      try {
         // Get the person object associated with the request
         person = PersonManagerFactory.getPersonManagerInstance().getPerson(request);
         if (person != null) {
             // Retrieve the security context for the user
             ISecurityContext securityContext = person.getSecurityContext();
             if (securityContext.isAuthenticated()) {
                 if (log.isDebugEnabled())
                     log.debug("LogoutServlet::getRedirectionUrl()" +
                         " Looking for redirect string for the root context");
                redirect = (String)REDIRECT_MAP.get("root");
View Full Code Here

    private IPerson person;
   
    private RestrictedPerson restrictedPerson;
   
    protected void setUp() {
        IPerson fullPerson = new PersonImpl();
        fullPerson.setAttribute("att1", "val1");
        fullPerson.setAttribute("att2", "val2");
       
        fullPerson.setFullName("George Washington");
       
        fullPerson.setID(27);
       
        fullPerson.setSecurityContext(new DummySecurityContext());
       
       
        this.person = fullPerson;
        this.restrictedPerson = new RestrictedPerson(fullPerson);
    }
View Full Code Here

        final IUserLayoutManager userLayoutManager = createMock(IUserLayoutManager.class);
        final IUserLayoutChannelDescription userLayoutChannelDescription = createMock(IUserLayoutChannelDescription.class);
        final IPortletDefinitionRegistry portletDefinitionRegistry = createMock(IPortletDefinitionRegistry.class);
        final IPortletDefinition portletDefinition = createMock(IPortletDefinition.class);
        final IChannelDefinition channelDefinition = createMock(IChannelDefinition.class);
        final IPerson person = createMock(IPerson.class);
        final IPortletEntityRegistry portletEntityRegistry = createMock(IPortletEntityRegistry.class);
        final IPortletEntity portletEntity = createMock(IPortletEntity.class);
        final IPortletWindow portletWindow = createMock(IPortletWindow.class);
       
        final MockPortletDefinitionId portletDefinitionId = new MockPortletDefinitionId("42");
        final MockPortletEntityId portletEntityId = new MockPortletEntityId("subId1");
        final MockPortletWindowId portletWindowId = new MockPortletWindowId("windowId1");
       
        expect(userInstanceManager.getUserInstance(request)).andReturn(userInstance);
        expect(userInstance.getPreferencesManager()).andReturn(userPreferencesManager);
        expect(userPreferencesManager.getUserLayoutManager()).andReturn(userLayoutManager);
        expect(userLayoutManager.getSubscribeId("my-info-student-center-home")).andReturn("subId1");
        expect(userLayoutManager.getNode("subId1")).andReturn(userLayoutChannelDescription);
        expect(userLayoutChannelDescription.getChannelPublishId()).andReturn("42");
        expect(portletDefinitionRegistry.getPortletDefinition(42)).andReturn(portletDefinition);
        expect(portletDefinition.getChannelDefinition()).andReturn(channelDefinition);
        expect(channelDefinition.isPortlet()).andReturn(true);
        expect(userInstance.getPerson()).andReturn(person);
        expect(portletDefinition.getPortletDefinitionId()).andReturn(portletDefinitionId);
        expect(person.getID()).andReturn(37);
        expect(portletEntityRegistry.getOrCreatePortletEntity(portletDefinitionId, "subId1", 37)).andReturn(portletEntity);
        expect(portletEntity.getPortletEntityId()).andReturn(portletEntityId);
        expect(portletWindowRegistry.createDefaultPortletWindow(request, portletEntityId)).andReturn(portletWindow);
        expect(portletWindow.getPortletWindowId()).andReturn(portletWindowId);
        expect(portletWindowRegistry.createTransientPortletWindowId(request, portletWindowId)).andReturn(portletWindowId);
View Full Code Here

/**
* @return org.jasig.portal.groups.IEntity
*/
private IPerson getIPerson(String key)
{
    IPerson ip = new PersonImpl();
    ip.setAttribute(IPerson.USERNAME, key);
    return  ip;
}
View Full Code Here

    print(CR + "***** ENTERING PAGSTester.testStringEqualsTester() *****" + CR);
    String msg = null;
  
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
       
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomStrings[0]);
    newPerson.setAttribute(key2, randomStrings[1]);
    newPerson.setAttribute(key3, stringVector);

    msg = "Testing IPerson " + newPerson;
    print(msg);

    IPersonTester tester1 = new StringEqualsTester(key1, randomStrings[0]);
View Full Code Here

    print(CR + "***** ENTERING PAGSTester.testStringEqualsIgnoreCaseTester() *****" + CR);
    String msg = null;
  
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
       
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomStrings[0]);
    newPerson.setAttribute(key2, randomStrings[1].toLowerCase());
    msg = "Testing IPerson " + newPerson;
    print(msg);

    String testKey = randomStrings[0].toLowerCase();
View Full Code Here

{
    print(CR + "***** ENTERING PAGSTester.testIntegerEQTester() *****" + CR);
    String msg = null;
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
       
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomIntStrings[0]);
    newPerson.setAttribute(key2, randomIntStrings[1]);
    newPerson.setAttribute(key3, intStringVector);


    msg = "Testing IPerson " + newPerson;
    print(msg);

View Full Code Here

    print(CR + "***** ENTERING PAGSTester.testIntegerGTTester() *****" + CR);
    String msg = null;
   
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
      
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomIntStrings[0]);
    newPerson.setAttribute(key2, randomIntStrings[1]);
    newPerson.setAttribute(key3, intStringVector);

    msg = "Testing IPerson " + newPerson;
    print(msg);

    // test value == attribute value.  Should answer false.
View Full Code Here

TOP

Related Classes of org.jasig.portal.security.IPerson

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.