@Override
  public boolean hasAccess( RepositoryFilePermission perm ) throws KettleException {
    if ( hasAccess == null ) {
      hasAccess = new HashMap<RepositoryFilePermission, Boolean>();
    }
    if ( hasAccess.get( perm ) == null ) {
      hasAccess.put( perm, new Boolean( aclService.hasAccess( getObjectId(), perm ) ) );
    }
    return hasAccess.get( perm ).booleanValue();
  }
@Test
  public void testAccess() throws Exception {
    when( mockAclService.hasAccess( mockObjectId, RepositoryFilePermission.READ ) ).thenReturn( true );
    when( mockAclService.hasAccess( mockObjectId, RepositoryFilePermission.WRITE ) ).thenReturn( false );

    assertTrue( uiPurRepDir.hasAccess( RepositoryFilePermission.READ ) );
    assertFalse( uiPurRepDir.hasAccess( RepositoryFilePermission.WRITE ) );
  }