Package org.drools.guvnor.server.security

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


    public boolean acceptNavigate(String parentPath, String child) {
        // for GWT hosted mode - debug only
        if ( !Contexts.isSessionContextActive() ) {
            return true;
        }
        return Identity.instance().hasPermission( new CategoryPathType( makePath( parentPath, child ) ), "navigate" );

    }
View Full Code Here


        // Role-based Authorization check: This method only returns rules that
        // the user has permission to access. The user is considered to has
        // permission to access the particular category when: The user has
        // ANALYST_READ role or higher (i.e., ANALYST) to this category
        if ( !serviceSecurity.isSecurityIsAnalystReadWithTargetObject( new CategoryPathType( request.getCategoryPath() ) ) ) {
            List<CategoryPageRow> rowList = new ArrayList<CategoryPageRow>();
            PageResponse<CategoryPageRow> pageResponse = new PageResponseBuilder<CategoryPageRow>()
                    .withStartRowIndex(request.getStartRowIndex())
                    .withPageRowList(rowList)
                    .withLastPage(true)
View Full Code Here

        // Role-based Authorization check: This method only returns rules that
        // the user has permission to access. The user is considered to has
        // permission to access the particular category when: The user has
        // ANALYST_READ role or higher (i.e., ANALYST) to this category
        if ( !serviceSecurity.isSecurityIsAnalystReadWithTargetObject( new CategoryPathType( request.getCategoryPath() ) ) ) {
            List<CategoryPageRow> rowList = new ArrayList<CategoryPageRow>();
            return new PageResponseBuilder<CategoryPageRow>()
                    .withStartRowIndex(request.getStartRowIndex())
                    .withPageRowList(rowList)
                    .withLastPage(true)
View Full Code Here

        // Role-based Authorization check: This method only returns rules that
        // the user has permission to access. The user is considered to has
        // permission to access the particular category when: The user has
        // ANALYST_READ role or higher (i.e., ANALYST) to this category
        if ( !serviceSecurity.isSecurityIsAnalystRead( new CategoryPathType( request.getCategoryPath() ) ) ) {
            return new PageResponse<CategoryPageRow>();
        }

        return repositoryCategoryOperations.loadRuleListForCategories( request );
    }
View Full Code Here

                                                        int numRows,
                                                        String tableConfig) throws SerializationException {

        // First check the user has permission to access this categoryPath.
        if ( Contexts.isSessionContextActive() ) {
            if ( !Identity.instance().hasPermission( new CategoryPathType( categoryPath ),
                                                     RoleTypes.ANALYST_READ ) ) {

                TableDisplayHandler handler = new TableDisplayHandler( tableConfig );
                return handler.loadRuleListTable( new AssetItemPageResult() );
            }
View Full Code Here

            try {
                Identity.instance().checkPermission( new PackageNameType( asset.metaData.packageName ),
                                                     RoleTypes.PACKAGE_DEVELOPER );
            } catch ( RuntimeException e ) {
                if ( asset.metaData.categories.length == 0 ) {
                    Identity.instance().checkPermission( new CategoryPathType( null ),
                                                         RoleTypes.ANALYST );
                } else {
                    RuntimeException exception = null;

                    for ( String cat : asset.metaData.categories ) {
                        try {
                            Identity.instance().checkPermission( new CategoryPathType( cat ),
                                                                 RoleTypes.ANALYST );
                            passed = true;
                        } catch ( RuntimeException re ) {
                            exception = re;
                        }
View Full Code Here

            try {
                Identity.instance().checkPermission( new PackageNameType( asset.getPackage().getName() ),
                                                     RoleTypes.PACKAGE_DEVELOPER );
            } catch ( RuntimeException e ) {
                if ( asset.getCategories().size() == 0 ) {
                    Identity.instance().checkPermission( new CategoryPathType( null ),
                                                         RoleTypes.ANALYST );
                } else {
                    RuntimeException exception = null;

                    for ( CategoryItem cat : asset.getCategories() ) {
                        try {
                            Identity.instance().checkPermission( new CategoryPathType( cat.getFullPath() ),
                                                                 RoleTypes.ANALYST );
                            passed = true;
                        } catch ( RuntimeException re ) {
                            exception = re;
                        }
View Full Code Here

        response.getWriter().print( feed.getAtom() );
    }

    void checkCategoryPermission(String cat) {
        if ( Contexts.isSessionContextActive() ) {
            Identity.instance().checkPermission( new CategoryPathType( cat ),
                                                 RoleTypes.ANALYST_READ );
        }
    }
View Full Code Here

                                                        numRows );
    }

    private void handleLoadRuleAssetException(RuleAsset asset) {
        if ( asset.metaData.categories.length == 0 ) {
            Identity.instance().checkPermission( new CategoryPathType( null ),
                                                 RoleTypes.ANALYST_READ );
        } else {
            RuntimeException exception = null;
            boolean passed = false;
            for ( String cat : asset.metaData.categories ) {
                try {
                    Identity.instance().checkPermission( new CategoryPathType( cat ),
                                                         RoleTypes.ANALYST_READ );
                    passed = true;
                } catch ( RuntimeException re ) {
                    exception = re;
                }
View Full Code Here

     */
    public TableDataResult loadRuleListForCategories(String categoryPath, int skip, int numRows, String tableConfig) throws SerializationException {

        // First check the user has permission to access this categoryPath.
        if ( Contexts.isSessionContextActive() ) {
            if ( !Identity.instance().hasPermission( new CategoryPathType( categoryPath ), RoleTypes.ANALYST_READ ) ) {

                TableDisplayHandler handler = new TableDisplayHandler( tableConfig );
                return handler.loadRuleListTable( new AssetItemPageResult() );
            }
        }
View Full Code Here

TOP

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

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.