Package org.drools.guvnor.server.security

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


                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );

            List<RoleBasedPermission> pbps = new ArrayList<RoleBasedPermission>();
            pbps.add( new RoleBasedPermission( "jervis",
                                               RoleTypes.PACKAGE_READONLY,
                                               package1Name,
                                               null ) );
            pbps.add( new RoleBasedPermission( "jervis",
                                               RoleTypes.PACKAGE_DEVELOPER,
                                               package2Name,
                                               null ) );
            MockRoleBasedPermissionStore store = new MockRoleBasedPermissionStore( pbps );
            Contexts.getSessionContext().set( "org.drools.guvnor.server.security.RoleBasedPermissionStore",
View Full Code Here


                                              midentity );
            Contexts.getSessionContext().set( "org.drools.guvnor.client.rpc.RepositoryService",
                                              impl );

            List<RoleBasedPermission> pbps = new ArrayList<RoleBasedPermission>();
            pbps.add( new RoleBasedPermission( "jervis",
                                               RoleTypes.PACKAGE_READONLY,
                                               package1Name,
                                               null ) );
            pbps.add( new RoleBasedPermission( "jervis",
                                               RoleTypes.PACKAGE_DEVELOPER,
                                               package2Name,
                                               null ) );
            pbps.add( new RoleBasedPermission( "jervis",
                                               RoleTypes.ANALYST_READ,
                                               null,
                                               category1Name ) );
            MockRoleBasedPermissionStore store = new MockRoleBasedPermissionStore( pbps );
            Contexts.getSessionContext().set( "org.drools.guvnor.server.security.RoleBasedPermissionStore",
View Full Code Here

    @PostConstruct
    private void insertTestData() {
        RulesRepository rulesRepository = new RulesRepository(sessionForSetup);
        RoleBasedPermissionStore adminStore = new RoleBasedPermissionStore(rulesRepository);
        adminStore.addRoleBasedPermissionForTesting("admin",
                new RoleBasedPermission("admin", RoleType.ADMIN.getName(), null, null));
    }
View Full Code Here

        final String USERNAME = "categoryUser";
        loginAs( USERNAME );

        roleBasedPermissionResolver.setEnableRoleBasedAuthorization( true );
        roleBasedPermissionStore.addRoleBasedPermissionForTesting( USERNAME,
                                                                   new RoleBasedPermission( USERNAME,
                                                                                            RoleType.ANALYST.getName(),
                                                                                            null,
                                                                                            "/testLoadRuleListForCategoriesWithAnalystPermissionRootCat" ) );
        roleBasedPermissionManager.create(); // HACK flushes the permission cache
View Full Code Here

        final String USERNAME = "categoryUser";
        loginAs( USERNAME );

        roleBasedPermissionResolver.setEnableRoleBasedAuthorization( true );
        roleBasedPermissionStore.addRoleBasedPermissionForTesting( USERNAME,
                                                                   new RoleBasedPermission( USERNAME,
                                                                                            RoleType.ANALYST.getName(),
                                                                                            null,
                                                                                            "/testLoadRuleListForCategoriesWithAnalystNoRootCatPermission/testLoadRuleListForCategoriesWithAnalystNoRootCatPermissionCat1" ) );
        roleBasedPermissionManager.create(); // HACK flushes the permission cache
View Full Code Here

        loginAs( USER_NAME );
       
        //Hack to ensure there are permission records, granting an undefined role, for the user
        //An undefined role is used so as not to interfere with the roles recognised by Guvnor
        roleBasedPermissionStore.addRoleBasedPermissionForTesting( USER_NAME,
                                                                   new RoleBasedPermission( USER_NAME,
                                                                                            "UNDEFINED",
                                                                                            null,
                                                                                            null ) );
    }
View Full Code Here

                                           "testLoadRuleAssetAnalystCat2",
                                           "testLoadRuleAssetAnalyst",
                                           AssetFormats.DRL );

        roleBasedPermissionResolver.setEnableRoleBasedAuthorization(true);
        roleBasedPermissionStore.addRoleBasedPermissionForTesting(USER_NAME, new RoleBasedPermission( USER_NAME,
                                           RoleType.ANALYST.getName(),
                                           null,
                                           "testLoadRuleAssetAnalystCat1" ) );
        roleBasedPermissionManager.create(); // HACK flushes the permission cache
View Full Code Here

                                           "testLoadRuleAssetPackageReadonlyCat1",
                                           "testLoadRuleAssetPackageReadonlyPack2",
                                           AssetFormats.DRL );

        roleBasedPermissionResolver.setEnableRoleBasedAuthorization(true);
        roleBasedPermissionStore.addRoleBasedPermissionForTesting(USER_NAME, new RoleBasedPermission( USER_NAME,
                                           RoleType.PACKAGE_READONLY.getName(),
                                           package1Name,
                                           null ) );
        roleBasedPermissionManager.create(); // HACK flushes the permission cache
View Full Code Here

                                          null,
                                          "testLoadRuleAssetNoCategoryPackageAdminPack1",
                                          AssetFormats.DRL );

        roleBasedPermissionResolver.setEnableRoleBasedAuthorization(true);
        roleBasedPermissionStore.addRoleBasedPermissionForTesting(USER_NAME, new RoleBasedPermission( USER_NAME,
                                           RoleType.PACKAGE_ADMIN.getName(),
                                           packageName,
                                           null ) );
        roleBasedPermissionManager.create(); // HACK flushes the permission cache
View Full Code Here

                                           "testLoadRuleAssetNoCategoryAnalystCat2",
                                           "testLoadRuleAssetNoCategoryAnalystPack1",
                                           AssetFormats.DRL );

        roleBasedPermissionResolver.setEnableRoleBasedAuthorization(true);
        roleBasedPermissionStore.addRoleBasedPermissionForTesting(USER_NAME, new RoleBasedPermission( USER_NAME,
                                           RoleType.ANALYST.getName(),
                                           null,
                                           "testLoadRuleAssetNoCategoryAnalystCat2" ) );
        roleBasedPermissionManager.create(); // HACK flushes the permission cache
View Full Code Here

TOP

Related Classes of org.drools.guvnor.server.security.RoleBasedPermission

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.