// 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 AssetPageList() );
}
}
//use AssetItemFilter to enforce package-based permissions.
// RepositoryFilter filter = new AssetItemFilter();
// Filter is null since the permission is checked on category level.
RepositoryFilter filter = null;
AssetPageList list = repository.findAssetsByCategory( categoryPath,
false,
skip,
numRows,
filter );
TableDisplayHandler handler = new TableDisplayHandler( tableConfig );
// log.debug("time for load: " + (System.currentTimeMillis() - time) );
return handler.loadRuleListTable( list );
}