public Document getUsers() throws ServletException, IOException, IllegalAccessException {
if ( !canAdminister() ) {
throw new IllegalAccessException();
}
IUserRoleListService service = PentahoSystem.get( IUserRoleListService.class );
Element rootElement = new DefaultElement( "users" ); //$NON-NLS-1$
Document doc = DocumentHelper.createDocument( rootElement );
if ( service != null ) {
List<String> users = service.getAllUsers();
for ( Iterator<String> usersIterator = users.iterator(); usersIterator.hasNext(); ) {
String username = usersIterator.next().toString();
if ( ( null != username ) && ( username.length() > 0 ) ) {
rootElement.addElement( "user" ).setText( username ); //$NON-NLS-1$
}