Search in sources :

Example 11 with PersonImpl

use of org.apereo.portal.security.provider.PersonImpl in project uPortal by Jasig.

the class ProfileSelectionEventTest method setUp.

@Before
public void setUp() {
    initMocks(this);
    person = new PersonImpl();
    person.setID(1);
    differentPerson = new PersonImpl();
    differentPerson.setID(2);
    samePerson = new PersonImpl();
    samePerson.setID(1);
}
Also used : PersonImpl(org.apereo.portal.security.provider.PersonImpl) Before(org.junit.Before)

Example 12 with PersonImpl

use of org.apereo.portal.security.provider.PersonImpl in project uPortal by Jasig.

the class ServerNameGuestChainingProfileMapperTest method createGuestPerson.

protected static IPerson createGuestPerson() throws Exception {
    IPerson person = new PersonImpl();
    person.setAttribute(IPerson.USERNAME, "guest");
    return person;
}
Also used : IPerson(org.apereo.portal.security.IPerson) PersonImpl(org.apereo.portal.security.provider.PersonImpl)

Example 13 with PersonImpl

use of org.apereo.portal.security.provider.PersonImpl in project uPortal by Jasig.

the class FragmentActivator method bindToOwner.

private IPerson bindToOwner(FragmentDefinition fragment) {
    IPerson owner = new PersonImpl();
    owner.setAttribute("username", fragment.getOwnerId());
    int userID = -1;
    try {
        userID = identityStore.getPortalUID(owner, false);
    } catch (AuthorizationException ae) {
    // current implementation of RDMBUserIdentityStore throws an
    // auth exception if the user doesn't exist even if
    // create data is false as we have it here. So this exception
    // can be discarded since we check for the userID being -1
    // meaning that the user wasn't found to trigger creating
    // that user.
    }
    if (userID == -1) {
        userID = createOwner(owner, fragment);
        owner.setAttribute(NEWLY_CREATED_ATTR, "" + (userID != -1));
    }
    owner.setID(userID);
    return owner;
}
Also used : IPerson(org.apereo.portal.security.IPerson) PersonImpl(org.apereo.portal.security.provider.PersonImpl) AuthorizationException(org.apereo.portal.AuthorizationException)

Example 14 with PersonImpl

use of org.apereo.portal.security.provider.PersonImpl in project uPortal by Jasig.

the class FragmentActivator method loadPreferences.

private void loadPreferences(UserView view, FragmentDefinition fragment) {
    // if fragment not bound to user can't return any preferences.
    if (view.getUserId() == -1)
        return;
    IPerson p = new PersonImpl();
    p.setID(view.getUserId());
    p.setAttribute("username", fragment.getOwnerId());
}
Also used : IPerson(org.apereo.portal.security.IPerson) PersonImpl(org.apereo.portal.security.provider.PersonImpl)

Example 15 with PersonImpl

use of org.apereo.portal.security.provider.PersonImpl in project uPortal by Jasig.

the class InjectAttributeRegexTesterTest method getIPerson.

/** @return org.apereo.portal.groups.IEntity */
private IPerson getIPerson(String key) {
    IPerson ip = new PersonImpl();
    ip.setAttribute(IPerson.USERNAME, key);
    return ip;
}
Also used : IPerson(org.apereo.portal.security.IPerson) PersonImpl(org.apereo.portal.security.provider.PersonImpl)

Aggregations

PersonImpl (org.apereo.portal.security.provider.PersonImpl)16 IPerson (org.apereo.portal.security.IPerson)12 IUserProfile (org.apereo.portal.IUserProfile)4 BrokenSecurityContext (org.apereo.portal.security.provider.BrokenSecurityContext)4 ArrayList (java.util.ArrayList)2 AuthorizationException (org.apereo.portal.AuthorizationException)2 Tuple (org.apereo.portal.utils.Tuple)2 Before (org.junit.Before)2 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Iterator (java.util.Iterator)1 LinkedHashSet (java.util.LinkedHashSet)1 UserProfile (org.apereo.portal.UserProfile)1 LocaleManager (org.apereo.portal.i18n.LocaleManager)1 IJoinQueryString (org.apereo.portal.jdbc.IJoinQueryString)1 PortletPreferenceImpl (org.apereo.portal.portlet.dao.jpa.PortletPreferenceImpl)1 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)1 IPortletEntity (org.apereo.portal.portlet.om.IPortletEntity)1