code: public RestWorkspaces getWorkspaces( HttpServletRequest request,
                                           String repositoryName ) throws RepositoryException {
          assert request != null;
          assert repositoryName != null;
  
          RestWorkspaces workspaces = new RestWorkspaces();
          Session session = getSession(request, repositoryName, null);
          for (String workspaceName : session.getWorkspace().getAccessibleWorkspaceNames()) {
              String repositoryUrl = RestHelper.urlFrom(request);
              workspaces.addWorkspace(workspaceName, repositoryUrl);
          }
          return workspaces;
      }
docs: Returns the list of workspaces available to this user within the named repository.
  
  @param request the servlet request; may not be null
  @param repositoryName the name of the repository; may not be null
  @return the list of workspaces available to this user within the named repository, as a {@link RestWorkspaces} object
  
  @throws RepositoryException if there is any other error accessing the list of available workspaces for the repository