Package com.dotmarketing.exception

Examples of com.dotmarketing.exception.DotSecurityException



  public void copy(Folder folderToCopy, Host newParentHost, User user, boolean respectFrontEndPermissions) throws DotDataException,
      DotSecurityException, DotStateException, IOException {
    if (!papi.doesUserHavePermission(folderToCopy, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions)) {
      throw new DotSecurityException("User " + user + " does not have permission to read " + folderToCopy.getName());
    }

    if (!papi.doesUserHavePermission(newParentHost, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, respectFrontEndPermissions)) {
      throw new DotSecurityException("User " + user + " does not have permission to add to " + newParentHost.getHostname());
    }

    ffac.copy(folderToCopy, newParentHost);
  }
View Full Code Here


      return;
    } else {
      AdminLogger.log(this.getClass(), "delete", "Deleting folder with name " + (UtilMethods.isSet(folder.getName()) ? folder.getName() + " ": "name not set "), user);
    }
    if (!papi.doesUserHavePermission(folder, PermissionAPI.PERMISSION_EDIT, user, respectFrontEndPermissions)) {
      throw new DotSecurityException("User " + user + " does not have permission to edit " + folder.getName());
    }


    if(folder != null && FolderAPI.SYSTEM_FOLDER.equals(folder.getInode())) {
      throw new DotSecurityException("YOU CANNOT DELETE THE SYSTEM FOLDER");
    }
    boolean localTransaction = false;

    // start transactional delete
    try {
      localTransaction = DbConnectionFactory.getConnection().getAutoCommit();

      if (localTransaction) {
        HibernateUtil.startTransaction();
      }
      PermissionAPI papi = APILocator.getPermissionAPI();
      if (!papi.doesUserHavePermission(folder, PermissionAPI.PERMISSION_EDIT_PERMISSIONS, user)) {
        Logger.error(this.getClass(), "User " + user.getUserId() + " does not have permissions to folder " + folder.getInode());
        throw new DotSecurityException("User " + "does not have edit permissions on folder " + folder.getTitle());
      }

      Folder faker = new Folder();
      faker.setShowOnMenu(folder.isShowOnMenu());
      faker.setInode(folder.getInode());
View Full Code Here

  public Folder find(String id, User user, boolean respectFrontEndPermissions)throws DotSecurityException, DotDataException {

    Folder folder= ffac.find(id);
    if (!papi.doesUserHavePermission(folder, PermissionAPI.PERMISSION_READ, user)) {
      throw new DotSecurityException("User " + user + " does not have permission to read " + folder.getName());
    }
    return folder;
  }
View Full Code Here

    if(parent ==null){
      throw new DotStateException("No Folder Found for id: " + id.getParentPath());
    }
    if (!papi.doesUserHavePermission(parent, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user,respectFrontEndPermissions)
        || !papi.doesUserHavePermissions(PermissionableType.FOLDERS, PermissionAPI.PERMISSION_EDIT, user)) {
      throw new DotSecurityException("User " + user + " does not have permission to add to " + name);
    }

    folder.setModDate(new Date());

    ffac.save(folder, existingId);
View Full Code Here

  }

    public List<HTMLPage> getHTMLPages ( Host host, User user, boolean respectFrontEndPermissions ) throws DotStateException, DotDataException, DotSecurityException {

        if ( !papi.doesUserHavePermission( host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions ) ) {
            throw new DotSecurityException( "User " + user + " does not have permission to read  " + host.getHostname() );
        }

        ChildrenCondition cond = new ChildrenCondition();
        cond.working = true;
        cond.deleted = false;
View Full Code Here

    }

  public  List<HTMLPage> getHTMLPages(Folder parent, User user, boolean respectFrontEndPermissions) throws DotStateException,
  DotDataException, DotSecurityException{
    if (!papi.doesUserHavePermission(parent, PermissionAPI.PERMISSION_READ, user,respectFrontEndPermissions)) {
      throw new DotSecurityException("User " + user + " does not have permission to read  " + parent.getName());
    }
    ChildrenCondition cond = new ChildrenCondition();
    cond.working=true;
    cond.deleted=false;
    List list = ffac.getChildrenClass(parent, HTMLPage.class,cond);
View Full Code Here

  }

    public List<HTMLPage> getHTMLPages ( Host host, boolean working, boolean deleted, User user, boolean respectFrontEndPermissions ) throws DotStateException, DotDataException, DotSecurityException {

        if ( !papi.doesUserHavePermission( host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions ) ) {
            throw new DotSecurityException( "User " + user + " does not have permission to read  " + host.getHostname() );
        }

        ChildrenCondition cond = new ChildrenCondition();
        cond.working = working;
        cond.deleted = deleted;
View Full Code Here

    }

    public  List<HTMLPage> getHTMLPages(Folder parent, boolean working, boolean deleted, User user, boolean respectFrontEndPermissions) throws DotStateException,
    DotDataException, DotSecurityException{
        if (!papi.doesUserHavePermission(parent, PermissionAPI.PERMISSION_READ, user,respectFrontEndPermissions)) {
            throw new DotSecurityException("User " + user + " does not have permission to read  " + parent.getName());
        }
        ChildrenCondition cond = new ChildrenCondition();
        cond.working=working;
        cond.deleted=deleted;
        List list = ffac.getChildrenClass(parent, HTMLPage.class,cond);
View Full Code Here

    }

  public  List<Link> getLinks(Folder parent, boolean working, boolean deleted, User user, boolean respectFrontEndPermissions) throws DotStateException,
    DotDataException, DotSecurityException{
        if (!papi.doesUserHavePermission(parent, PermissionAPI.PERMISSION_READ, user,respectFrontEndPermissions)) {
            throw new DotSecurityException("User " + user + " does not have permission to read  " + parent.getName());
        }
        ChildrenCondition cond = new ChildrenCondition();
        cond.working=working;
        cond.deleted=deleted;
        List list = ffac.getChildrenClass(parent, Link.class,cond);
View Full Code Here

    }

    public List<Link> getLinks ( Host host, boolean working, boolean deleted, User user, boolean respectFrontEndPermissions ) throws DotStateException, DotDataException, DotSecurityException {

        if ( !papi.doesUserHavePermission( host, PermissionAPI.PERMISSION_READ, user, respectFrontEndPermissions ) ) {
            throw new DotSecurityException( "User " + user + " does not have permission to read  " + host.getHostname() );
        }

        ChildrenCondition cond = new ChildrenCondition();
        cond.working = working;
        cond.deleted = deleted;
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.