Package org.codehaus.plexus.redback.system

Examples of org.codehaus.plexus.redback.system.SecuritySession


    {  
        if ( pRequest.getConfig() instanceof XmlRpcHttpRequestConfigImpl )
        {
            XmlRpcHttpRequestConfigImpl config = (XmlRpcHttpRequestConfigImpl) pRequest.getConfig();
            username = config.getBasicUserName();
            SecuritySession session =
                authenticate( new PasswordBasedAuthenticationDataSource( username,
                                                                         config.getBasicPassword() ) );
           
            String method = pRequest.getMethodName();           
            AuthorizationResult result = authorize( session, method, username );
View Full Code Here


    {
        // do the authz bit
        ActionContext context = ActionContext.getContext();

        PlexusContainer container = (PlexusContainer) context.getApplication().get( PlexusConstants.PLEXUS_KEY );
        SecuritySession securitySession =
            (SecuritySession) context.getSession().get( SecuritySystemConstants.SECURITY_SESSION_KEY );

        try
        {
            SecuritySystem securitySystem = (SecuritySystem) container.lookup( SecuritySystem.ROLE );
View Full Code Here

    {
        // do the authz bit
        ActionContext context = ActionContext.getContext();

        PlexusContainer container = (PlexusContainer) context.getApplication().get( PlexusConstants.PLEXUS_KEY );
        SecuritySession securitySession =
            (SecuritySession) context.getSession().get( SecuritySystemConstants.SECURITY_SESSION_KEY );

        try
        {
            SecuritySystem securitySystem = (SecuritySystem) container.lookup( SecuritySystem.ROLE );
View Full Code Here

            {
                throw new UnauthorizedException( "User account is locked." );
            }

            AuthenticationResult authn = new AuthenticationResult( true, principal, null );
            SecuritySession securitySession = new DefaultSecuritySession( authn, user );

            return securitySystem.isAuthorized( securitySession, ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS,
                                                repoId );
        }
        catch ( UserNotFoundException e )
View Full Code Here

        if ( sessionMap == null )
        {
            return getGuest();
        }

      SecuritySession securitySession =
            (SecuritySession) sessionMap.get( SecuritySystemConstants.SECURITY_SESSION_KEY );

        if ( securitySession == null )
        {
            securitySession = (SecuritySession) sessionMap.get( SecuritySession.ROLE );
        }

        if ( securitySession == null )
        {
            return getGuest();
        }

        User user = securitySession.getUser();       
        if ( user == null )
        {
            return getGuest();
        }
View Full Code Here

            throw new ArchivaRestServiceException( "user " + userName + " not found" );
        }

        // check karma on source : read
        AuthenticationResult authn = new AuthenticationResult( true, userName, null );
        SecuritySession securitySession = new DefaultSecuritySession( authn, user );
        try
        {
            boolean authz =
                securitySystem.isAuthorized( securitySession, ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS,
                                             artifactTransferRequest.getRepositoryId() );
View Full Code Here

        throws DavException
    {
        try
        {
            AuthenticationResult result = httpAuth.getAuthenticationResult( request, null );
            SecuritySession securitySession = httpAuth.getSecuritySession( request.getSession( true ) );

            return servletAuth.isAuthenticated( request, result ) && servletAuth.isAuthorized( request, securitySession,
                                                                                               repositoryId,
                                                                                               WebdavMethodUtil.getMethodPermission(
                                                                                                   request.getMethod() ) );
View Full Code Here

        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 =
            servletAuth.isAuthorized( request, session, "corporate", ArchivaRoleConstants.OPERATION_REPOSITORY_UPLOAD );

        assertTrue( isAuthorized );
View Full Code Here

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

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

        SecuritySession session = new DefaultSecuritySession( result, user );

        httpServletRequestControl.replay();

        try
        {
View Full Code Here

        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 =
            servletAuth.isAuthorized( request, session, "corporate", ArchivaRoleConstants.OPERATION_REPOSITORY_ACCESS );

        assertTrue( isAuthorized );
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.redback.system.SecuritySession

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.