Package com.dotmarketing.exception

Examples of com.dotmarketing.exception.DotSecurityException


  public Versionable findWorkingVersion(String id, User user, boolean respectAnonPermissions) throws DotDataException, DotStateException,
      DotSecurityException {

    Versionable asset = vfac.findWorkingVersion(id);
    if (!papi.doesUserHavePermission((Permissionable) asset, PermissionAPI.PERMISSION_READ, user, respectAnonPermissions)) {
      throw new DotSecurityException("User " + user + " does not have permission to read " + id);
    }

    return asset;
  }
View Full Code Here


  public Versionable findLiveVersion(String id, User user, boolean respectAnonPermissions) throws DotDataException, DotStateException,
      DotSecurityException {
    Versionable asset = vfac.findLiveVersion(id);
    if (asset!=null && !papi.doesUserHavePermission((Permissionable) asset, PermissionAPI.PERMISSION_READ, user, respectAnonPermissions)) {
      throw new DotSecurityException("User " + user + " does not have permission to read " + id);
    }

    return asset;
  }
View Full Code Here

  public Versionable findDeletedVersion(String id, User user, boolean respectAnonPermissions) throws DotDataException, DotStateException,
      DotSecurityException {

    Versionable asset = vfac.findDeletedVersion(id);
    if (!papi.doesUserHavePermission((Permissionable) asset, PermissionAPI.PERMISSION_READ, user, respectAnonPermissions)) {
      throw new DotSecurityException("User " + user + " does not have permission to read " + id);
    }

    return asset;
  }
View Full Code Here

  public Template copy(Template sourceTemplate, Host destination, boolean forceOverwrite, List<ContainerRemapTuple> containerMappings, User user,
      boolean respectFrontendRoles)
      throws DotDataException, DotSecurityException {

    if (!permissionAPI.doesUserHavePermission(sourceTemplate, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {
      throw new DotSecurityException("You don't have permission to read the source file.");
    }

    if (!permissionAPI.doesUserHavePermission(destination, PermissionAPI.PERMISSION_WRITE, user, respectFrontendRoles)) {
      throw new DotSecurityException("You don't have permission to write in the destination folder.");
    }

    boolean isNew = false;
    Template newTemplate;
    if (forceOverwrite) {
View Full Code Here

  public List<HTMLPage> getPagesUsingTemplate(Template template, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException {

    if (!permissionAPI.doesUserHavePermission(template, PermissionAPI.PERMISSION_READ, user,
        respectFrontendRoles)) {
      throw new DotSecurityException("You don't have permission to read the template file.");
    }

    return templateFactory.getPagesUsingTemplate(template);
  }
View Full Code Here

      boolean copySourceContainers, User user, boolean respectFrontendRoles) throws DotDataException,
      DotSecurityException {

    if (!permissionAPI.doesUserHavePermission(sourceTemplate, PermissionAPI.PERMISSION_READ, user,
        respectFrontendRoles)) {
      throw new DotSecurityException("You don't have permission to read the source file.");
    }

    if (!permissionAPI.doesUserHavePermission(destination, PermissionAPI.PERMISSION_WRITE, user,
        respectFrontendRoles)) {
      throw new DotSecurityException("You don't have permission to write in the destination folder.");
    }

    List<ContainerRemapTuple> remap = new LinkedList<ContainerRemapTuple>();
    if (copySourceContainers) {
      List<Container> sourceContainers = getContainersInTemplate(sourceTemplate, user, respectFrontendRoles);
View Full Code Here

            :null;


    if ((oldTemplate != null) && InodeUtils.isSet(oldTemplate.getInode())) {
      if (!permissionAPI.doesUserHavePermission(oldTemplate, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {
        throw new DotSecurityException("You don't have permission to read the source file.");
      }
    }

    if (!permissionAPI.doesUserHavePermission(destination, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, respectFrontendRoles)) {
      throw new DotSecurityException("You don't have permission to wirte in the destination folder.");
    }

    if (!permissionAPI.doesUserHavePermissions(PermissionableType.TEMPLATES, PermissionAPI.PERMISSION_EDIT, user)) {
      throw new DotSecurityException("You don't have permission to edit templates.");
    }


    //gets identifier from the current asset
    Identifier identifier = null;
View Full Code Here

  @Override
  public List<Container> getContainersInTemplate(Template template, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException {
      if(template!=null && InodeUtils.isSet(template.getInode())) {

        if (!permissionAPI.doesUserHavePermission(template, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {
          throw new DotSecurityException("You don't have permission to read the source file.");
        }


        return templateFactory.getContainersInTemplate(template, user, respectFrontendRoles);
      }
View Full Code Here

  public boolean delete(Template template, User user, boolean respectFrontendRoles) throws DotSecurityException,
      Exception {
    if(permissionAPI.doesUserHavePermission(template, PermissionAPI.PERMISSION_WRITE, user, respectFrontendRoles)) {
      return deleteAsset(template);
    } else {
      throw new DotSecurityException(WebKeys.USER_PERMISSIONS_EXCEPTION);
    }
  }
View Full Code Here

  public Template find(String inode, User user,  boolean respectFrontEndRoles) throws DotSecurityException,
      DotDataException {
    Template t =  templateFactory.find(inode);
    if(t!=null && InodeUtils.isSet(t.getInode()) &&
          !permissionAPI.doesUserHavePermission(t, PermissionAPI.PERMISSION_READ, user, respectFrontEndRoles)){
      throw new DotSecurityException("User does not have access to template:" + inode);
    }
    return t;

  }
View Full Code Here

TOP

Related Classes of com.dotmarketing.exception.DotSecurityException

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.