Package org.codehaus.plexus.redback.rbac

Examples of org.codehaus.plexus.redback.rbac.UserAssignment


            String principal = UserManager.GUEST_USERNAME;

            try
            {
                UserAssignment ua;

                if ( rbacManager.userAssignmentExists( principal ) )
                {
                    ua = rbacManager.getUserAssignment( principal );
                }
                else
                {
                    ua = rbacManager.createUserAssignment( principal );
                }

                ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) );
                rbacManager.saveUserAssignment( ua );
            }
            catch ( RbacManagerException e )
            {
                log.warn( "Unable to add role [" + ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) + "] to "
View Full Code Here


    }

    protected void restoreGuestInitialValues( String userId )
        throws Exception
    {
        UserAssignment userAssignment = null;
        try
        {
            userAssignment = rbacManager.getUserAssignment( userId );
        }
        catch ( RbacObjectNotFoundException e )
        {
            log.info( "ignore RbacObjectNotFoundException for id {} during restoreGuestInitialValues", userId );
            return;
        }
        userAssignment.setRoleNames( Lists.newArrayList( "Guest" ) );
        rbacManager.saveUserAssignment( userAssignment );
        CacheManager.getInstance().clearAll();
    }
View Full Code Here

            // TODO: Use the Redback / UserConfiguration..getString( "redback.default.guest" ) to get the right name.
            String principal = "guest";
           
            try
            {
                UserAssignment ua;

                if ( rbacManager.userAssignmentExists( principal ) )
                {
                    ua = rbacManager.getUserAssignment( principal );
                }
                else
                {
                    ua = rbacManager.createUserAssignment( principal );
                }

                ua.addRoleName( ArchivaRoleConstants.REPOSITORY_OBSERVER_ROLE_PREFIX + " - " + repoId );
                rbacManager.saveUserAssignment( ua );
            }
            catch ( RbacManagerException e )
            {
                getLogger().warn(
View Full Code Here

            // TODO: Use the Redback / UserConfiguration..getString( "redback.default.guest" ) to get the right name.
            String principal = "guest";
           
            try
            {
                UserAssignment ua;

                if ( rbacManager.userAssignmentExists( principal ) )
                {
                    ua = rbacManager.getUserAssignment( principal );
                }
                else
                {
                    ua = rbacManager.createUserAssignment( principal );
                }

                ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) );
                rbacManager.saveUserAssignment( ua );
            }
            catch ( RbacManagerException e )
            {
                getLogger().warn( "Unable to add role [" + ArchivaRoleConstants.toRepositoryObserverRoleName( repoId )
View Full Code Here

            // TODO: Use the Redback / UserConfiguration..getString( "redback.default.guest" ) to get the right name.
            String principal = "guest";

            try
            {
                UserAssignment ua;

                if ( rbacManager.userAssignmentExists( principal ) )
                {
                    ua = rbacManager.getUserAssignment( principal );
                }
                else
                {
                    ua = rbacManager.createUserAssignment( principal );
                }

                ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) );
                rbacManager.saveUserAssignment( ua );
            }
            catch ( RbacManagerException e )
            {
                getLogger().warn(
View Full Code Here

            // TODO: Use the Redback / UserConfiguration..getString( "redback.default.guest" ) to get the right name.
            String principal = "guest";

            try
            {
                UserAssignment ua;

                if ( rbacManager.userAssignmentExists( principal ) )
                {
                    ua = rbacManager.getUserAssignment( principal );
                }
                else
                {
                    ua = rbacManager.createUserAssignment( principal );
                }

                ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) );
                rbacManager.saveUserAssignment( ua );
            }
            catch ( RbacManagerException e )
            {
                log.warn(
View Full Code Here

            String principal = UserManager.GUEST_USERNAME;

            try
            {
                UserAssignment ua;

                if ( rbacManager.userAssignmentExists( principal ) )
                {
                    ua = rbacManager.getUserAssignment( principal );
                }
                else
                {
                    ua = rbacManager.createUserAssignment( principal );
                }

                ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) );
                rbacManager.saveUserAssignment( ua );
            }
            catch ( RbacManagerException e )
            {
                log.warn(
View Full Code Here

        Role role4 = new JdoRole();
        role4.setName( "Project Administrator - Project A" );
        roles.add( role4 );

        List<UserAssignment> userAssignments = new ArrayList<UserAssignment>();
        UserAssignment ua1 = new JdoUserAssignment();
        ua1.setPrincipal( "user1" );
        userAssignments.add( ua1 );

        List<Role> eRoles = roles;

        continuum.expects( once() ).method( "getProjectGroupWithProjects" ).will( returnValue( group ) );
View Full Code Here

        Role role5 = new JdoRole();
        role5.setName( "Project Administrator - Project C" );
        roles.add( role5 );

        List<UserAssignment> userAssignments = new ArrayList<UserAssignment>();
        UserAssignment ua1 = new JdoUserAssignment();
        ua1.setPrincipal( "user1" );
        userAssignments.add( ua1 );

        List<Role> eRoles = new ArrayList<Role>();
        eRoles.add( role1 );
        eRoles.add( role2 );
View Full Code Here

            // TODO: Use the Redback / UserConfiguration..getString( "redback.default.guest" ) to get the right name.
            String principal = "guest";
           
            try
            {
                UserAssignment ua;

                if ( rbacManager.userAssignmentExists( principal ) )
                {
                    ua = rbacManager.getUserAssignment( principal );
                }
                else
                {
                    ua = rbacManager.createUserAssignment( principal );
                }

                ua.addRoleName( ArchivaRoleConstants.toRepositoryObserverRoleName( repoId ) );
                rbacManager.saveUserAssignment( ua );
            }
            catch ( RbacManagerException e )
            {
                log.warn( "Unable to add role [" + ArchivaRoleConstants.toRepositoryObserverRoleName( repoId )
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.redback.rbac.UserAssignment

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.