Package org.kuali.rice.kim.api.identity.principal

Examples of org.kuali.rice.kim.api.identity.principal.Principal


    for (EntityExternalIdentifierBo extId: results) {
      entityId = extId.getEntityId();
    }
    // get the first principal and return details
    Entity entity = getIdentityService().getEntity(entityId);
    Principal principal = entity.getPrincipals().get(0);
    List<GrantedAuthority> auths = new ArrayList<GrantedAuthority>();
    auths.add(new SimpleGrantedAuthority("ROLE_USER"));
    if (principal.isActive()) {
      return new User(principal.getPrincipalName(), "password", true, true, true, true, auths);
    } else {
      return new User(principal.getPrincipalName(), "password", false, false, false, false, auths);
    }
  }
View Full Code Here


   * @param expectedPrincipalName - the expected principal name
   * @param expectedAffilCode TODO
   * @return the entity name for further tests
   */
  public EntityNameContract testCreatePrincipal(String expectedPrincipalName, String expectedAffilCode) {
    Principal principal = idSvc.getPrincipalByPrincipalName(expectedPrincipalName);
    assertNotNull("principal should have been created", principal);
   
    Person person = KimApiServiceLocator.getPersonService().getPersonByPrincipalName(expectedPrincipalName);
    assertNotNull("person should have been created", person);
   
    EntityDefault entity = idSvc.getEntityDefault(principal.getEntityId());
    assertNotNull("entity should have been created", entity);
   
    Map<String, String> criteria = new HashMap<String, String>();
    criteria.put("entityId", entity.getEntityId());
    Collection<EntityAffiliationBo> results = getBoSvc().findMatching(EntityAffiliationBo.class, criteria);
View Full Code Here

   * @param principalName - the principal name to test
   * @param isActive - whether the principal is active or not
   */
  public void testGet_ldapPerson(String principalName, boolean isActive) {
   
    Principal person = ldapDao.getPrincipal(principalName);
    assertNotNull("ldap principal should not be null", person);
    assertEquals("ldap principal id differs from given username", principalName, person.getPrincipalId());
    assertEquals("ldap principal name differs from given username", principalName, person.getPrincipalName());
    assertEquals("principal should be active", isActive, person.isActive());
    // TODO - getEntityDefault/Info does not work yet
    //KimEntityDefaultInfo info = idSvc.getEntityDefaultInfoByPrincipalName(username);
    //assertNotNull(info);
    //TODO - extend LdapPrincipalDaoImpl and add lookups for email and department
  }
View Full Code Here

TOP

Related Classes of org.kuali.rice.kim.api.identity.principal.Principal

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.