Package org.jasig.portal.security.provider

Examples of org.jasig.portal.security.provider.PersonImpl


   
    Assert.assertEquals("guest-clg37-default", fname);
  }
 
  protected static IPerson createGuestPerson() throws Exception {
        IPerson person = new PersonImpl();
        person.setAttribute(IPerson.USERNAME, "guest");
       
        return person;
  }
View Full Code Here


       
        return person;
  }
 
  protected static IPerson createPerson() throws Exception {
        IPerson person = new PersonImpl();
        person.setAttribute(IPerson.USERNAME, "non_guest");
       
        return person;
  }
View Full Code Here

public class ParenTest extends TestCase {

    public void testIsApplicable() {

        IPerson p = new PersonImpl();

        // Paren.Type.OR...
        Paren orParen = new Paren(Paren.Type.OR);
        orParen.addEvaluator(new AllUsersEvaluatorFactory());
        assertTrue("true should make true", orParen.isApplicable(p));
View Full Code Here

            this.logger.warn("No user " + userName + " found, no layout will be exported");
            return null;
        }
       
        //Setup empty IPerson used to interact with the layout store
        final PersonImpl person = new PersonImpl();
        person.setUserName(userName);
        person.setID(userId);
        person.setSecurityContext(new BrokenSecurityContext());
       

        try {
            this.userLayoutStore.setProfileImportExportCache(layoutCache);
            this.userLayoutStore.setLayoutImportExportCache(profileCache);
View Full Code Here

          }
        }
  }

    private IPerson getPerson(final String username, boolean create) {
        final IPerson person = new PersonImpl();
        person.setUserName(username);
       
        int userId;
        try {
            userId = this.userIdentityStore.getPortalUID(person);
        }
        catch (final Throwable t) {
            if (!create || this.errorOnMissingUser) {
                throw new RuntimeException("Unrecognized user " + person.getUserName() + "; you must import users before their layouts.", t);
            }
           
            if (create) {
                userId = this.userIdentityStore.getPortalUID(person, true);
            }
            else {
                return null;
            }
        }
     
        person.setID(userId);
        person.setSecurityContext(new BrokenSecurityContext());
        return person;
    }
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

    String strAttributeName = "mail";
    String intAttributeName = "num";
   
    @Before
    public void setUp() {
        person = new PersonImpl();
        person.setUserName("testuser");
       
        List<Object> emailAddresses = new ArrayList<Object>();
        emailAddresses.add("testuser1@somewhere.com");
        emailAddresses.add("testuser1@elsewhere.com");
View Full Code Here

        userLayoutStore.setUserLayout(owner, profile, view.layout, true, false);
    }

    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;
    }
View Full Code Here

    {
        // 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() );
    }
View Full Code Here

                            int defaultProfileUser = rs.getInt(1);
                            if (rs.wasNull()) {
                                throw new RuntimeException("Need to clone the '" + profileFname + "' profile from template user for " + person + " but they have no template user");
                            }

                            IPerson defaultProfilePerson = new PersonImpl();
                            defaultProfilePerson.setID(defaultProfileUser);
                            if(defaultProfilePerson.getID() != person.getID()) {
                                UserProfile templateProfile = getUserProfileByFname(defaultProfilePerson,profileFname);
                                if(templateProfile != null) {
                                    UserProfile newUserProfile = new UserProfile(templateProfile);
                                    final Locale[] userLocales = localeStore.getUserLocales(person);
                                    newUserProfile.setLayoutId(0);
View Full Code Here

TOP

Related Classes of org.jasig.portal.security.provider.PersonImpl

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.