Package ch.entwine.weblounge.common.security

Examples of ch.entwine.weblounge.common.security.User


   * .
   */
  @Test
  public void testGetWithAuthor() throws Exception {
    populateIndex();
    User amelie = new UserImpl("amelie");
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).withAuthor(amelie);
    SearchResult result = idx.getByQuery(q);
    assertEquals(pages.length, result.getDocumentCount());
    assertEquals(pages.length, result.getDocumentCount());
  }
View Full Code Here


   * .
   */
  @Test
  public void testGetWithCreator() throws Exception {
    populateIndex();
    User hans = new UserImpl("hans");
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).withCreator(hans);
    SearchResult result = idx.getByQuery(q);
    assertEquals(pages.length, result.getDocumentCount());
    assertEquals(pages.length, result.getDocumentCount());
  }
View Full Code Here

   * .
   */
  @Test
  public void testGetWithModifier() throws Exception {
    populateIndex();
    User amelie = new UserImpl("amelie");
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).withModifier(amelie);
    SearchResult result = idx.getByQuery(q);
    assertEquals(pages.length, result.getDocumentCount());
    assertEquals(pages.length, result.getDocumentCount());
  }
View Full Code Here

   * .
   */
  @Test
  public void testGetWithPublisher() throws Exception {
    populateIndex();
    User amelie = new UserImpl("amelie");
    SearchQuery q = new SearchQueryImpl(site).withTypes(Page.TYPE).withPublisher(amelie);
    SearchResult result = idx.getByQuery(q);
    assertEquals(1, result.getDocumentCount());
    assertEquals(1, result.getDocumentCount());
  }
View Full Code Here

        throw new WebApplicationException(Status.PRECONDITION_FAILED);
      }
    }

    // Get the user
    User user = securityService.getUser();
    if (user == null)
      throw new WebApplicationException(Status.UNAUTHORIZED);

    // Make sure the user has editing rights
    if (!SecurityUtils.userHasRole(user, SystemRole.EDITOR))
View Full Code Here

      logger.warn("Page lookup {} failed for site '{}'", pageURI, site);
      throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
    }

    // Get the user
    User user = securityService.getUser();
    if (user == null)
      throw new WebApplicationException(Status.UNAUTHORIZED);

    // Make sure the user has editing rights
    if (!SecurityUtils.userHasRole(user, SystemRole.EDITOR))
View Full Code Here

      logger.warn("Error lookup up page {} from repository: {}", livePageURI, e.getMessage());
      throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
    }

    // Get the user
    User user = securityService.getUser();
    if (user == null)
      throw new WebApplicationException(Status.UNAUTHORIZED);

    // Make sure the user has editing rights
    if (!SecurityUtils.userHasRole(user, SystemRole.EDITOR))
View Full Code Here

        throw new WebApplicationException(Status.PRECONDITION_FAILED);
      }
    }

    // Get the user
    User user = securityService.getUser();
    if (user == null)
      throw new WebApplicationException(Status.UNAUTHORIZED);

    // Make sure the user has editing rights
    if (!SecurityUtils.userHasRole(user, SystemRole.EDITOR))
View Full Code Here

        throw new WebApplicationException(Status.PRECONDITION_FAILED);
      }
    }

    // Get the user
    User user = securityService.getUser();
    if (user == null)
      throw new WebApplicationException(Status.UNAUTHORIZED);

    // Make sure the user has editing rights
    if (!SecurityUtils.userHasRole(user, SystemRole.EDITOR))
View Full Code Here

      logger.warn("Error looking up referenced resources", e);
      throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
    }

    // Get the user
    User user = securityService.getUser();
    if (user == null)
      throw new WebApplicationException(Status.UNAUTHORIZED);

    // Make sure the user has publishing rights
    if (!SecurityUtils.userHasRole(user, SystemRole.PUBLISHER))
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.security.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.