Examples of loadUser()


Examples of ch.entwine.weblounge.common.security.DirectoryService.loadUser()

    // Check for existing administrative accounts with the same login
    ServiceReference userDirectoryRef = bundleCtx.getServiceReference(DirectoryService.class.getName());
    if (userDirectoryRef != null) {
      DirectoryService systemDirectory = (DirectoryService) bundleCtx.getService(userDirectoryRef);
      logger.debug("Checking new site '{}' user '{}' for shadowing of site or system account");
      User shadowedUser = systemDirectory.loadUser(user, site);
      if (shadowedUser != null) {
        if (SecurityUtils.userHasRole(shadowedUser, SYSTEMADMIN))
          throw new UserShadowedException("Site '" + site.getIdentifier() + "' account '" + user + "' is shadowing the system account");
        else if (SecurityUtils.userHasRole(shadowedUser, SITEADMIN))
          throw new UserShadowedException("Site '" + site.getIdentifier() + "' account '" + user + "' is shadowing the site account");
View Full Code Here

Examples of ch.entwine.weblounge.common.security.SiteDirectory.loadUser()

    johnAlterEgo.addPublicCredentials(roleB);
    johnAlterEgo.addPublicCredentials(roleC);

    SiteDirectory directoryA = EasyMock.createNiceMock(SiteDirectory.class);
    EasyMock.expect(directoryA.getIdentifier()).andReturn(site.getIdentifier()).anyTimes();
    EasyMock.expect(directoryA.loadUser((String) EasyMock.anyObject(), (Site) EasyMock.anyObject())).andReturn(john).anyTimes();
    EasyMock.replay(directoryA);

    SiteDirectory directoryB = EasyMock.createNiceMock(SiteDirectory.class);
    EasyMock.expect(directoryB.getIdentifier()).andReturn(site.getIdentifier()).anyTimes();
    EasyMock.expect(directoryB.loadUser((String) EasyMock.anyObject(), (Site) EasyMock.anyObject())).andReturn(johnAlterEgo).anyTimes();
View Full Code Here

Examples of ch.entwine.weblounge.common.security.SiteDirectory.loadUser()

    EasyMock.expect(directoryA.loadUser((String) EasyMock.anyObject(), (Site) EasyMock.anyObject())).andReturn(john).anyTimes();
    EasyMock.replay(directoryA);

    SiteDirectory directoryB = EasyMock.createNiceMock(SiteDirectory.class);
    EasyMock.expect(directoryB.getIdentifier()).andReturn(site.getIdentifier()).anyTimes();
    EasyMock.expect(directoryB.loadUser((String) EasyMock.anyObject(), (Site) EasyMock.anyObject())).andReturn(johnAlterEgo).anyTimes();
    EasyMock.replay(directoryB);

    SecurityService securityService = EasyMock.createNiceMock(SecurityService.class);
    EasyMock.expect(securityService.getSite()).andReturn(site).anyTimes();
    EasyMock.replay(securityService);
View Full Code Here

Examples of ch.entwine.weblounge.common.security.SystemDirectory.loadUser()

                  if (userDirectoryRef != null) {
                    SystemDirectory systemDirectory = (SystemDirectory) bundleContext.getService(userDirectoryRef);
                    User siteAdmin = site.getAdministrator();
                    if (siteAdmin != null) {
                      logger.debug("Checking site '{}' admin user '{}' for shadowing of system account");
                      User shadowedUser = systemDirectory.loadUser(siteAdmin.getLogin(), site);
                      if (shadowedUser != null && SecurityUtils.userHasRole(shadowedUser, SystemRole.SYSTEMADMIN)) {
                        throw new IllegalStateException("Site '" + site.getIdentifier() + "' administrative account '" + siteAdmin.getLogin() + "' is shadowing the system account");
                      }
                    }
                  } else {
View Full Code Here

Examples of org.jboss.test.hibernate.ejb.interfaces.ProfileService.loadUser()

         assertEquals( "Incorrect result size", 1, users.size() );

         Long userId = ( ( User ) users.get( 0 ) ).getId();
         assertEquals( "Saved used not returned", savedUserId, userId );

         user = service.loadUser( savedUserId );
         assertNotNull( user );
      }
      finally
      {
         if ( service != null )
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession.loadUser()

            if (idValue instanceof Long) {
                id = ((Long)idValue).longValue();
            } else {
                id = Long.valueOf(idValue.toString()).longValue();
            }
            final User user = identitySession.loadUser(id);
            if (user == null) {
                context.setError("Error loading user", "No user was found with an ID of " + id);
                return;
            }
            targetExpression.setValue(elContext, user);
View Full Code Here

Examples of org.superbiz.deltaspike.repository.UserRepository.loadUser()

        final String userName = "gp";
        final String firstName = "Gerhard";
        final String lastName = "Petracek";

        UserRepository mockedUserRepository = mock(JpaUserRepository.class); //don't use the interface here to avoid issues with mockito and cdi proxies
        when(mockedUserRepository.loadUser(userName)).thenReturn(new User(userName, firstName, lastName.toUpperCase() /*just to illustrate that the mock-instance is used*/));
        mockManager.addMock(mockedUserRepository);


        this.windowContext.activateWindow("testWindow");

View Full Code Here

Examples of org.w3c.jigsaw.auth.AuthRealm.loadUser()

  // If we did get the realm:
  if ( rr_realm != null ) {
      try {
    AuthRealm realm = (AuthRealm) rr_realm.lock();
    // Get the user:
    ResourceReference rr_user = realm.loadUser(username);
    if (rr_user == null)
        return false;
    try {
        AuthUser user = (AuthUser)rr_user.lock();
        // Check the old password first:
View Full Code Here

Examples of org.w3c.jigsaw.auth.AuthRealm.loadUser()

      try {
    AuthRealm realm = (AuthRealm) rr_realm.lock();
    Enumeration e   = realm.enumerateUserNames() ;
    while (e.hasMoreElements()) {
        String   uname = (String) e.nextElement() ;
        ResourceReference rr_user = realm.loadUser(uname) ;
        try {
      AuthUser user  = (AuthUser) rr_user.lock();
      createEntry(user);
        } catch (InvalidResourceException ex) {
      System.out.println("Invalid user reference : "+uname);
View Full Code Here

Examples of org.xulfaces.rubis.admin.dao.UserDAO.loadUser()

      while (resultSet.next()) {
        Item item = new Item();
        item.setId(new Integer(resultSet.getInt("ID")));
        item.setName(resultSet.getString("NAME"));     
        try {
          item.setSeller(userDAO.loadUser(new Integer(resultSet.getInt("SELLER"))));
        } catch (UserNotFoundException e) {         
          e.printStackTrace();
        }
        item.setCategory(category);
        item.setBuyNow(resultSet.getFloat("BUY_NOW"));
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.