String methodBase = StringUtils.capitalizeFirstLetter( token );
private CRole buildRole( Entry<String, ContentClass> entry, String method ) { String content = entry.getKey(); CRole view = new CRole(); view.setId( content + "-all-" + method ); String contentClassName = entry.getValue().getName(); if ( entry.getValue() instanceof RootContentClass ) { // NXCM-3544 set name to empty string to generate 'All Repositories' role name/description contentClassName = ""; } view.setDescription( "Gives access to " + method + " ALL " + contentClassName + " Repositories in Nexus." ); method = StringUtils.capitalizeFirstLetter( method ); view.setName( "Repo: All " + contentClassName + " Repositories (" + method + ")" ); view.setSessionTimeout( 60 ); List<? extends Repository> repos = getRepositoriesWithContentClass( entry.getValue() ); for ( Repository repo : repos ) { view.addPrivilege( "repository-" + repo.getId() ); } return view; }