Package ch.entwine.weblounge.common.security

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


        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 publishing rights
    if (!SecurityUtils.userHasRole(user, SystemRole.PUBLISHER))
View Full Code Here


    // Make sure there is a home page
    ResourceURI homeURI = new ResourceURIImpl(Page.TYPE, site, "/");
    if (!existsInAnyVersion(homeURI)) {
      try {
        Page page = new PageImpl(homeURI);
        User siteAdmininstrator = new UserImpl(site.getAdministrator());
        page.setTemplate(site.getDefaultTemplate().getIdentifier());
        page.setCreated(siteAdmininstrator, new Date());
        page.setPublished(siteAdmininstrator, new Date(), null);
        put(page, true);
        logger.info("Created homepage for {}", site.getIdentifier());
View Full Code Here

      andEmpty(PUBLISHED_FROM);
    }

    // Lock owner
    if (query.getLockOwner() != null) {
      User user = query.getLockOwner();
      if (SearchQueryImpl.ANY_USER.equals(user.getLogin()))
        andNotEmpty(LOCKED_BY);
      else
        and(LOCKED_BY, IndexUtils.serializeUserId(user), true);
    }
View Full Code Here

  @GET
  @Path("/statistics")
  public Response getstatistics(@Context HttpServletRequest request) {

    // Make sure the user has site administrator rights
    User user = securityService.getUser();
    if (!SecurityUtils.userHasRole(user, SystemRole.SITEADMIN))
      throw new WebApplicationException(Status.FORBIDDEN);

    Site site = getSite(request);
    ContentRepository repository = getContentRepository(site, false);
View Full Code Here

  @DELETE
  @Path("/")
  public Response reindex(@Context HttpServletRequest request) {

    // Make sure the user has site administrator rights
    User user = securityService.getUser();
    if (!SecurityUtils.userHasRole(user, SystemRole.SITEADMIN))
      throw new WebApplicationException(Status.FORBIDDEN);

    Site site = getSite(request);
    ContentRepository repository = getContentRepository(site, true);
View Full Code Here

        if (mimeType == null)
          throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
      }

      // Get the current 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

    ResourceURI uri = resource.getURI();
    Site site = getSite(request);

    // Get the current 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 current 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

    Site site = getSite(request);
    WritableContentRepository contentRepository = (WritableContentRepository) getContentRepository(site, true);

    // Get the current 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

    Site site = getSite(request);
    WritableContentRepository contentRepository = (WritableContentRepository) getContentRepository(site, true);

    // Get the current 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

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.