Package com.dotmarketing.exception

Examples of com.dotmarketing.exception.DotSecurityException


    if(!isLegacyFilesSupported()){
      throw new DotStateException("File Assets have been disabled.");
    }

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

    return FactoryLocator.getFileFactory().saveFile(newFile, dataFile, folder, identifier);
  }
View Full Code Here


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

  public List<File> getFolderFiles(Folder parentFolder, boolean live, User user, boolean respectFrontendRoles) throws DotDataException,
      DotSecurityException {

    if (!permissionAPI.doesUserHavePermission(parentFolder, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {
      throw new DotSecurityException("You don't have permission to read the destination folder.");
    }
   
    ChildrenCondition cond = new ChildrenCondition();
    if(live)
      cond.live=true;
View Full Code Here

    File file = (File) vapi.findWorkingVersion(fileId, user, respectFrontendRoles);
    if (file == null)
      return file;
    if (!permissionAPI.doesUserHavePermission(file, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles))
      throw new DotSecurityException("User " + user.getUserId() + "has no permissions to read file id " + fileId);

    return file;
  }
View Full Code Here

  public File get(String inode, User user, boolean respectFrontendRoles) throws DotHibernateException, DotSecurityException,
      DotDataException {
    File file = ffac.get(inode);

    if (!permissionAPI.doesUserHavePermission(file, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {
      throw new DotSecurityException(WebKeys.USER_PERMISSIONS_EXCEPTION);
    }

    return file;
  }
View Full Code Here

        if ( !isLegacyFilesSupported() ) {
            throw new DotStateException( "File Assets have been disabled." );
        }

        if ( !permissionAPI.doesUserHavePermission( file, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles ) ) {
            throw new DotSecurityException( WebKeys.USER_PERMISSIONS_EXCEPTION );
        } else if ( parent != null && !permissionAPI.doesUserHavePermission( parent, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, respectFrontendRoles ) ) {
            throw new DotSecurityException( WebKeys.USER_PERMISSIONS_EXCEPTION );
        } else if ( host != null && !permissionAPI.doesUserHavePermission( host, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, respectFrontendRoles ) ) {
            throw new DotSecurityException( WebKeys.USER_PERMISSIONS_EXCEPTION );
        }

        if ( parent != null ) {
            return ffac.copyFile( file, parent );
        } else {
View Full Code Here

    if(!isLegacyFilesSupported()){
      throw new DotStateException("File Assets have been disabled.");
    }
   
    if (!permissionAPI.doesUserHavePermission(file, PermissionAPI.PERMISSION_WRITE, user, respectFrontendRoles)) {
      throw new DotSecurityException(WebKeys.USER_PERMISSIONS_EXCEPTION);
    }

    return ffac.renameFile(file, newName);
  }
View Full Code Here

    if(!isLegacyFilesSupported()){
      throw new DotStateException("File Assets have been disabled.");
    }

        if ( !permissionAPI.doesUserHavePermission( file, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles ) ) {
            throw new DotSecurityException( WebKeys.USER_PERMISSIONS_EXCEPTION );
        } else if ( parent != null && !permissionAPI.doesUserHavePermission( parent, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, respectFrontendRoles ) ) {
            throw new DotSecurityException( WebKeys.USER_PERMISSIONS_EXCEPTION );
        } else if ( host != null && !permissionAPI.doesUserHavePermission( host, PermissionAPI.PERMISSION_CAN_ADD_CHILDREN, user, respectFrontendRoles ) ) {
            throw new DotSecurityException( WebKeys.USER_PERMISSIONS_EXCEPTION );
        }

        if ( parent != null ) {
            return ffac.moveFile(file, parent);
        } else {
View Full Code Here

    if(!isLegacyFilesSupported()){
      throw new DotStateException("File Assets have been disabled.");
    }
   
    if (!permissionAPI.doesUserHavePermission(file, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {
      throw new DotSecurityException(WebKeys.USER_PERMISSIONS_EXCEPTION);
    }
    ffac.publishFile(file);

  }
View Full Code Here

  public File getFileByURI(String uri, Host host, boolean live, User user, boolean respectFrontendRoles) throws DotDataException,
      DotSecurityException {
    File file = ffac.getFileByURI(uri, host, live);
    if (file!=null && !permissionAPI.doesUserHavePermission(file, PermissionAPI.PERMISSION_READ, user, respectFrontendRoles)) {
      throw new DotSecurityException(WebKeys.USER_PERMISSIONS_EXCEPTION);
    }
    return file;
  }
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.