Examples of MockIdentity


Examples of org.drools.guvnor.server.security.MockIdentity

        }
        return repository;
    }

    protected void setUpMockIdentity() {
        MockIdentity mockIdentity = new MockIdentity();
        mockIdentity.setIsLoggedIn( true );
        RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
        resolver.setEnableRoleBasedAuthorization( false );
        mockIdentity.addPermissionResolver( new RoleBasedPermissionResolver() );
        setUpMockIdentity( mockIdentity );
    }
View Full Code Here

Examples of org.drools.guvnor.server.security.MockIdentity

            // Mock up SEAM contexts
            //            Map<String, Object> application = new HashMap<String, Object>();
            //            Lifecycle.beginApplication( application );
            //            Lifecycle.beginCall();
            MockIdentity midentity = new MockIdentity();
            RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
            resolver.setEnableRoleBasedAuthorization( true );
            midentity.addPermissionResolver( resolver );
            midentity.create();

            Contexts.getSessionContext().set( "org.jboss.seam.security.identity",
                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );
View Full Code Here

Examples of org.drools.guvnor.server.security.MockIdentity

            // Mock up SEAM contexts
            Map<String, Object> application = new HashMap<String, Object>();
            Lifecycle.beginApplication( application );
            Lifecycle.beginCall();
            MockIdentity midentity = new MockIdentity();
            RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
            resolver.setEnableRoleBasedAuthorization( true );
            midentity.addPermissionResolver( resolver );
            midentity.create();

            Contexts.getSessionContext().set( "org.jboss.seam.security.identity",
                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );
View Full Code Here

Examples of org.drools.guvnor.server.security.MockIdentity

            // Mock up SEAM contexts
            Map<String, Object> application = new HashMap<String, Object>();
            Lifecycle.beginApplication( application );
            Lifecycle.beginCall();
            MockIdentity midentity = new MockIdentity();
            RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
            resolver.setEnableRoleBasedAuthorization( false );
            midentity.addPermissionResolver( resolver );
            midentity.create();

            Contexts.getSessionContext().set( "org.jboss.seam.security.identity",
                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );
View Full Code Here

Examples of org.drools.guvnor.server.security.MockIdentity

            // Mock up SEAM contexts
            Map<String, Object> application = new HashMap<String, Object>();
            Lifecycle.beginApplication( application );
            Lifecycle.beginCall();
            MockIdentity midentity = new MockIdentity();
            RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
            resolver.setEnableRoleBasedAuthorization( true );
            midentity.addPermissionResolver( resolver );
            midentity.create();

            Contexts.getSessionContext().set( "org.jboss.seam.security.identity",
                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );
View Full Code Here

Examples of org.drools.guvnor.server.security.MockIdentity

            // Mock up SEAM contexts
            Map<String, Object> application = new HashMap<String, Object>();
            Lifecycle.beginApplication( application );
            Lifecycle.beginCall();
            MockIdentity midentity = new MockIdentity();
            RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
            resolver.setEnableRoleBasedAuthorization( true );
            midentity.addPermissionResolver( resolver );
            midentity.create();

            Contexts.getSessionContext().set( "org.jboss.seam.security.identity",
                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );
View Full Code Here

Examples of org.drools.guvnor.server.security.MockIdentity

            // Mock up SEAM contexts
            Map<String, Object> application = new HashMap<String, Object>();
            Lifecycle.beginApplication( application );
            Lifecycle.beginCall();
            MockIdentity midentity = new MockIdentity();
            RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
            resolver.setEnableRoleBasedAuthorization( true );
            midentity.addPermissionResolver( resolver );
            midentity.create();

            Contexts.getSessionContext().set( "org.jboss.seam.security.identity",
                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );
View Full Code Here

Examples of org.drools.guvnor.server.security.MockIdentity

            // Mock up SEAM contexts
            Map<String, Object> application = new HashMap<String, Object>();
            Lifecycle.beginApplication( application );
            Lifecycle.beginCall();
            MockIdentity midentity = new MockIdentity();
            RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
            resolver.setEnableRoleBasedAuthorization( true );
            midentity.addPermissionResolver( resolver );
            midentity.create();

            Contexts.getSessionContext().set( "org.jboss.seam.security.identity",
                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );
View Full Code Here

Examples of org.drools.guvnor.server.security.MockIdentity

            // Mock up SEAM contexts
            Map<String, Object> application = new HashMap<String, Object>();
            Lifecycle.beginApplication( application );
            Lifecycle.beginCall();
            MockIdentity midentity = new MockIdentity();
            RoleBasedPermissionResolver resolver = new RoleBasedPermissionResolver();
            resolver.setEnableRoleBasedAuthorization( true );
            midentity.addPermissionResolver( resolver );
            midentity.create();

            Contexts.getSessionContext().set( "org.jboss.seam.security.identity",
                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );
View Full Code Here

Examples of org.drools.guvnor.server.security.MockIdentity

                                                  "testSecurityCreateNewRule",
                                                  "this is a cat" );

        Lifecycle.beginApplication( new HashMap<String, Object>() );
        Lifecycle.beginCall();
        MockIdentity mi = new MockIdentity();
        mi.inject();
        mi.create();

        try {
            impl.createNewRule( "testCreateNewRuleName22",
                                "an initial desc",
                                "testSecurityCreateNewRule",
                                "testSecurityCreateNewRule",
                                AssetFormats.DSL_TEMPLATE_RULE );
            fail( "not allowed" );
        } catch ( AuthorizationException e ) {
            assertNotNull( e.getMessage() );
        }

        mi.addPermissionResolver( new PermissionResolver() {
            public void filterSetByAction(Set<Object> arg0,
                                          String arg1) {
            }

            public boolean hasPermission(Object arg0,
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.