Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.User


        _geonetworkAuthenticationProvider.authenticate(authentication);
    }

    @Test
    public void testAuthenticateWithTokenWithCorrectCredentials() throws Exception {
        final User user = userFoundSetup(PasswordEncoding.CURRENT);
        mockAuthenticationSetup(user);
        TestCase.assertNotNull("Authentication with correct credentials should succeed",
                _geonetworkAuthenticationProvider.authenticate(authentication));
    }
View Full Code Here


  }

  //--------------------------------------------------------------------------

  public String getUserId() {
    User userDetails = getPrincipal();
    if (userDetails == null) {
      return null;  
    } else {
      return String.valueOf(userDetails.getId());
    }
  }
View Full Code Here

    } else {
      return String.valueOf(userDetails.getId());
    }
  }
  public String getUsername() {
    User userDetails = getPrincipal();
    if (userDetails == null) {
      return null;  
    } else {
      return userDetails.getUsername();
    }
  }
View Full Code Here

    } else {
      return userDetails.getUsername();
    }
  }
  public String getName() {
    User userDetails = getPrincipal();
    if (userDetails == null) {
      return null;  
    } else {
      return userDetails.getName();
    }
  }
View Full Code Here

    } else {
      return userDetails.getName();
    }
  }
  public String getSurname() {
    User userDetails = getPrincipal();
    if (userDetails == null) {
      return null;  
    } else {
      return userDetails.getSurname();
    }
  }
View Full Code Here

    } else {
      return userDetails.getSurname();
    }
  }
  public Profile getProfile() {
    User userDetails = getPrincipal();
    if (userDetails == null) {
      return null;
    } else {
      return userDetails.getProfile();
    }
  }
View Full Code Here

    } else {
      return userDetails.getProfile();
    }
  }
  public String getEmailAddr() {
    User userDetails = getPrincipal();
    if (userDetails == null) {
      return null;  
    } else {
      return userDetails.getEmail();
    }
  }
View Full Code Here

            // Retrieve contact data from users table
            String contactId = gc.getBean(SettingManager.class).getValue("system/csw/contactId");
            if ((contactId == null) || (contactId.equals(""))) {
                contactId = "-1";
            }
            User user = context.getBean(UserRepository.class).findOne(contactId);

            substitute(context, capabilities, cswCapabilitiesInfo,  user, currentLanguage);

      handleSections(request, capabilities);
View Full Code Here

      // null JeevesServlet arg because not running in servlet here
      jeeves.init(appPath, configPath, baseUrl, null);

      // Make session with all permissions
      session = new UserSession();
      User user = new User().
              setProfile(Profile.Administrator).
              setUsername(Profile.Administrator.name()).
              setId(0).
              setName(Profile.Administrator.name()).
              setSurname(Profile.Administrator.name());

    UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(user.getUsername(), null, user.getAuthorities() ) ;
    authentication.setDetails(user);

    if(SecurityContextHolder.getContext() == null) {
      SecurityContextHolder.createEmptyContext();
    }
View Full Code Here

    MetadataRepository _metadataRepo;

    @Test
    public void testDoImportMefVersion1() throws Exception {
        ServiceContext context = createServiceContext();
        User admin = loginAsAdmin(context);
        ImportMetadata importMetadata = new ImportMetadata(this, context).invoke();
        List<String> metadataIds = importMetadata.getMetadataIds();

        assertEquals(1, metadataIds.size());

        final Metadata metadata = _metadataRepo.findOne(metadataIds.get(0));

        assertNotNull(metadata);
        assertEquals(admin.getId(), metadata.getSourceInfo().getOwner());
    }
View Full Code Here

TOP

Related Classes of org.fao.geonet.domain.User

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.