Package org.apache.archiva.redback.users

Examples of org.apache.archiva.redback.users.User


        createUser( USER_ALPACA, "Al 'Archiva' Paca" );

        assignRepositoryObserverRole( USER_ALPACA, "corporate" );

        UserManager userManager = securitySystem.getUserManager();
        User user = userManager.findUser( USER_ALPACA );

        AuthenticationResult result = new AuthenticationResult( true, USER_ALPACA, null );

        SecuritySession session = new DefaultSecuritySession( result, user );
        boolean isAuthorized =
View Full Code Here


        throws Exception
    {
        createUser( USER_ALPACA, "Al 'Archiva' Paca" );

        UserManager userManager = securitySystem.getUserManager();
        User user = userManager.findUser( USER_ALPACA );

        AuthenticationResult result = new AuthenticationResult( true, USER_ALPACA, null );

        SecuritySession session = new DefaultSecuritySession( result, user );
        try
View Full Code Here

            throw new ArchivaRestServiceException( "copy of SNAPSHOT not supported", null );
        }

        // end check parameters

        User user = null;
        try
        {
            user = securitySystem.getUserManager().findUser( userName );
        }
        catch ( UserNotFoundException e )
View Full Code Here

    public boolean isAuthorized( String principal, String repoId, String permission )
        throws UnauthorizedException
    {
        try
        {
            User user = securitySystem.getUserManager().findUser( principal );
            if ( user == null )
            {
                throw new UnauthorizedException(
                    "The security system had an internal error - please check your system logs" );
            }
            if ( user.isLocked() )
            {
                throw new UnauthorizedException( "User account is locked." );
            }

            AuthenticationResult authn = new AuthenticationResult( true, principal, null );
View Full Code Here

    public User createUser( String username, String fullName, String emailAddress )
        throws UserManagerException
    {
        Exception lastException = null;
        boolean allFailed = true;
        User user = null;
        for ( UserManager userManager : userManagerPerId.values() )
        {
            try
            {
                if ( !userManager.isReadOnly() )
View Full Code Here

    public void deleteUser( String username )
        throws UserNotFoundException, UserManagerException
    {
        Exception lastException = null;
        boolean allFailed = true;
        User user = null;
        for ( UserManager userManager : userManagerPerId.values() )
        {
            try
            {
                if ( !userManager.isReadOnly() )
View Full Code Here

    @Override
    public User findUser( String username, boolean useCache )
        throws UserNotFoundException, UserManagerException
    {
        User user = null;
        if ( useUsersCache() && useCache )
        {
            user = usersCache.get( username );
            if ( user != null )
            {
View Full Code Here

    public User createGuestUser()
        throws UserManagerException
    {
        Exception lastException = null;
        boolean allFailed = true;
        User user = null;
        for ( UserManager userManager : userManagerPerId.values() )
        {
            try
            {
                if ( !userManager.isReadOnly() )
View Full Code Here

    private Registry registry;

    protected void triggerAuditEvent( String repositoryId, String resource, String action,
                                      AuditInformation auditInformation )
    {
        User user = auditInformation == null ? null : auditInformation.getUser();
        AuditEvent event = new AuditEvent( repositoryId, user == null ? "null" : user.getUsername(), resource, action );
        event.setRemoteIP( auditInformation == null ? "null" : auditInformation.getRemoteAddr() );

        for ( AuditListener listener : getAuditListeners() )
        {
            listener.auditEvent( event );
View Full Code Here

        return resource;
    }

    protected String getActivePrincipal( DavServletRequest request )
    {
        User sessionUser = httpAuth.getSessionUser( request.getSession() );
        return sessionUser != null ? sessionUser.getUsername() : UserManager.GUEST_USERNAME;
    }
View Full Code Here

TOP

Related Classes of org.apache.archiva.redback.users.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.