public List<String> getRolesForUser( String username ) { return userRoleListService.getRolesForUser( null, username ); }
@Override public List<String> getAllRoles() { return userRoleListService.getAllRoles(); }
@Override public List<String> getAllUsersForTenant( Tenant tenant ) { return userRoleListService.getAllUsers( tenant ); }
public List<String> getUsersInRole( String role ) { return userRoleListService.getUsersInRole( null, role ); }
private IUserRoleListService getUserRoleListServiceMock( String userName, String[] roles ) { IUserRoleListService mockUserRoleListService = mock( IUserRoleListService.class ); List<String> noRoles = new ArrayList<String>(); List<String> allRoles = new ArrayList<String>( Arrays.asList( roles ) ); when( mockUserRoleListService.getRolesForUser( Matchers.<ITenant>any(), eq( userName ) ) ).thenReturn( allRoles ); when( mockUserRoleListService.getRolesForUser( Matchers.<ITenant>any(), AdditionalMatchers.not( eq( userName ) ) ) ) .thenReturn( noRoles ); return mockUserRoleListService; } }
@Override public List<String> getAllUsers() { return userRoleListService.getAllUsers(); }
@Override public List<String> getAllRolesForTenant( Tenant tenant ) { return userRoleListService.getAllRoles( tenant ); }
roles = userRoleListService.getRolesForUser( null, principalName );
protected Object getSystemUserNames() { IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class ); if ( service != null ) { return service.getAllUsers(); } return null; }
protected Object getSystemRoleNames() { IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class ); if ( service != null ) { return service.getAllRoles(); } return null; }
List<String> roles = getUserRoleListService().getRolesForUser( JcrTenantUtils.getCurrentTenant(), username ); authorities = new ArrayList<GrantedAuthority>( roles.size() ); for ( String role : roles ) {
when( userRoleListService.getRolesForUser( Matchers.<ITenant>any(), eq( "suzy" ) ) ) .thenReturn( Collections.singletonList( "authenticated" ) );
when( userRoleListService.getRolesForUser( Matchers.<ITenant>any(), eq( "suzy" ) ) ).thenReturn( Collections.singletonList( "authenticated" ) );
mp.defineInstance( IRepositoryFileAclDao.class, repositoryFileAclDao ); IUserRoleListService userRoleListService = mock( IUserRoleListService.class ); when( userRoleListService.getRolesForUser( any( ITenant.class ), anyString() ) ).thenReturn( Arrays.asList( tenantAdminRoleName, AUTHENTICATED_ROLE_NAME ) ); mp.defineInstance( IUserRoleListService.class, userRoleListService );