Package org.pentaho.platform.repository.solution.dbbased

Examples of org.pentaho.platform.repository.solution.dbbased.RepositoryFile


  public void testVoter() throws Exception {
    SecurityHelper.getInstance().runAsUser( "suzy", new Callable<Void>() {

      @Override
      public Void call() throws Exception {
        RepositoryFile testFile = new RepositoryFile( "Test Folder", null, null ); //$NON-NLS-1$
        // RepositoryFile has no acls on it. Nobody should be able to access it.
        // But, we're using an allowAll voter.
        PentahoAllowAllAclVoter voter = new PentahoAllowAllAclVoter();
        assertTrue( voter.hasAccess( PentahoSessionHolder.getSession(), testFile, IPentahoAclEntry.PERM_EXECUTE ) );
        IPentahoAclEntry entry = voter.getEffectiveAcl( PentahoSessionHolder.getSession(), testFile );
View Full Code Here


  public void testVoter() throws Exception {
    SecurityHelper.getInstance().runAsUser( "suzy", new Callable<Void>() {

      @Override
      public Void call() throws Exception {
        RepositoryFile testFile = new RepositoryFile( "Test Folder", null, null ); //$NON-NLS-1$
        Map<IPermissionRecipient, IPermissionMask> perms = new LinkedHashMap<IPermissionRecipient, IPermissionMask>();
        perms.put( new SimpleUser( "suzy" ), new SimplePermissionMask( IPentahoAclEntry.PERM_EXECUTE ) );
        perms.put( new SimpleRole( "ROLE_POWER_USER" ), new SimplePermissionMask( IPentahoAclEntry.PERM_SUBSCRIBE ) );
        SpringSecurityPermissionMgr.instance().setPermissions( perms, testFile );
        PentahoBasicAclVoter voter = new PentahoBasicAclVoter();
View Full Code Here

  public void testVoter() throws Exception {
    SecurityHelper.getInstance().runAsUser( "suzy", new Callable<Void>() {

      @Override
      public Void call() throws Exception {
        RepositoryFile testFile = new RepositoryFile( "Test Folder", null, null ); //$NON-NLS-1$
        Map<IPermissionRecipient, IPermissionMask> perms = new LinkedHashMap<IPermissionRecipient, IPermissionMask>();
        perms.put( new SimpleUser( "suzy" ), new SimplePermissionMask( IPentahoAclEntry.PERM_NOTHING ) );
        perms.put( new SimpleRole( "ROLE_POWER_USER" ), new SimplePermissionMask(
          IPentahoAclEntry.PERM_FULL_CONTROL ) );
        SpringSecurityPermissionMgr.instance().getPermissions( testFile );
View Full Code Here

  public void testPublisher() {
    AclPublisher publisher = new AclPublisher( defaultAcls );
    assertNotNull( publisher );

    RepositoryFile rootFile = getPopulatedSolution();
    publisher.publishDefaultAcls( rootFile );
    checkAcls( rootFile );
  }
View Full Code Here

    publisher.publishDefaultAcls( rootFile );
    checkAcls( rootFile );
  }

  public static RepositoryFile getPopulatedSolution() {
    RepositoryFile root = new RepositoryFile( "root", null, null ); //$NON-NLS-1$
    final int topFolderCount = 3;
    final int subFolderCount = 3;
    final int filesPerFolder = 4;
    final byte[] fileData = "This is file data".getBytes(); //$NON-NLS-1$
    for ( int i = 0; i < topFolderCount; i++ ) {
      RepositoryFile topFolder = new RepositoryFile( "topFolder" + i, root, null ); //$NON-NLS-1$
      for ( int j = 0; j < subFolderCount; j++ ) {
        RepositoryFile subFolder = new RepositoryFile( "subFolder" + j, topFolder, null ); //$NON-NLS-1$
        for ( int k = 0; k < filesPerFolder; k++ ) {
          RepositoryFile aFile = new RepositoryFile( "aFile" + k, subFolder, fileData ); //$NON-NLS-1$
        }
      }
    }
    return root;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.repository.solution.dbbased.RepositoryFile

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.