Package org.pentaho.platform.repository2.unified.jcr.IAclMetadataStrategy

Examples of org.pentaho.platform.repository2.unified.jcr.IAclMetadataStrategy.AclMetadata


    throw new IllegalStateException( "no access control list applies or is bound to node" );
  }

  private static String getOwner( final Session session, final String path, final AccessControlList acList )
    throws RepositoryException {
    AclMetadata aclMetadata = JcrRepositoryFileAclUtils.getAclMetadata( session, path, acList );
    if ( aclMetadata != null ) {
      return aclMetadata.getOwner();
    } else {
      return null;
    }
  }
View Full Code Here


    }
  }

  private static boolean isEntriesInheriting( final Session session, final String path, final AccessControlList acList )
    throws RepositoryException {
    AclMetadata aclMetadata = JcrRepositoryFileAclUtils.getAclMetadata( session, path, acList );
    if ( aclMetadata != null ) {
      return aclMetadata.isEntriesInheriting();
    } else {
      return false;
    }
  }
View Full Code Here

    } );
  }

  protected String getOwner( final Session session, final String path, final AccessControlList acList )
    throws RepositoryException {
    AclMetadata aclMetadata = JcrRepositoryFileAclUtils.getAclMetadata( session, path, acList );
    if ( aclMetadata != null ) {
      return aclMetadata.getOwner();
    } else {
      return null;
    }
  }
View Full Code Here

    }
  }

  protected boolean isEntriesInheriting( final Session session, final String path, final AccessControlList acList )
    throws RepositoryException {
    AclMetadata aclMetadata = JcrRepositoryFileAclUtils.getAclMetadata( session, path, acList );
    if ( aclMetadata != null ) {
      return aclMetadata.isEntriesInheriting();
    } else {
      return false;
    }
  }
View Full Code Here

    AccessControlEntry[] acEntries = acList.getAccessControlEntries();
    for ( int i = 0; i < acEntries.length; i++ ) {
      acList.removeAccessControlEntry( acEntries[i] );
    }

    JcrRepositoryFileAclUtils.setAclMetadata( session, absPath, acList, new AclMetadata( acl.getOwner().getName(), acl
        .isEntriesInheriting() ) );

    // add entries to now empty list but only if not inheriting; force user to start with clean slate
    boolean adminPrincipalExist = false;
    ITenant principalTenant = null;
View Full Code Here

    while ( true ) {
      currentNode = findAccessControlledNode( currentNode );
      acl = new ACLTemplate( currentNode.getNode( N_POLICY ) );

      // skip all nodes that are inheriting
      AclMetadata aclMetadata = JcrRepositoryFileAclUtils.getAclMetadata( systemSession, currentNode.getPath(), acl );
      if ( aclMetadata != null && aclMetadata.isEntriesInheriting() ) {
        currentNode = (NodeImpl) currentNode.getParent();
        continue;
      }
      break;
    }
View Full Code Here

    currentNode = findAccessControlledNode( currentNode );
    acl = new ACLTemplate( currentNode.getNode( N_POLICY ) );

    // owner comes from the first access-controlled node
    String owner = null;
    AclMetadata aclMetadata = JcrRepositoryFileAclUtils.getAclMetadata( systemSession, currentNode.getPath(), acl );
    if ( aclMetadata != null ) {
      owner = aclMetadata.getOwner();
    }

    // find the ACL
    NodeImpl firstAccessControlledNode = currentNode;
    currentNode = findNonInheritingNode( currentNode );
View Full Code Here

  private void setAclManagement() {
    testJcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( Session session ) throws IOException, RepositoryException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        Workspace workspace = session.getWorkspace();
        PrivilegeManager privilegeManager = ( (JackrabbitWorkspace) workspace ).getPrivilegeManager();
        try {
          privilegeManager.getPrivilege( pentahoJcrConstants.getPHO_ACLMANAGEMENT_PRIVILEGE() );
        } catch ( AccessControlException ace ) {
          privilegeManager.registerPrivilege( pentahoJcrConstants.getPHO_ACLMANAGEMENT_PRIVILEGE(), false,
              new String[0] );
        }
        session.save();
        return null;
      }
View Full Code Here

  private void setAclManagement() {
    testJcrTemplate.execute( new JcrCallback() {
      @Override
      public Object doInJcr( Session session ) throws IOException, RepositoryException {
        PentahoJcrConstants pentahoJcrConstants = new PentahoJcrConstants( session );
        Workspace workspace = session.getWorkspace();
        PrivilegeManager privilegeManager = ( (JackrabbitWorkspace) workspace ).getPrivilegeManager();
        try {
          privilegeManager.getPrivilege( pentahoJcrConstants.getPHO_ACLMANAGEMENT_PRIVILEGE() );
        } catch ( AccessControlException ace ) {
          privilegeManager.registerPrivilege( pentahoJcrConstants.getPHO_ACLMANAGEMENT_PRIVILEGE(), false,
              new String[0] );
        }
        session.save();
        return null;
      }
View Full Code Here

    mp.define( ITenant.class, Tenant.class );
    mp.defineInstance( "tenantedUserNameUtils", tenantedUserNameUtils );
    mp.defineInstance( "tenantedRoleNameUtils", tenantedRoleNameUtils );
    mp.defineInstance( "roleAuthorizationPolicyRoleBindingDaoTarget", roleBindingDaoTarget );
    mp.defineInstance( "repositoryAdminUsername", repositoryAdminUsername );
    mp.defineInstance( "RepositoryFileProxyFactory", new RepositoryFileProxyFactory( this.jcrTemplate, this.repositoryFileDao ) );
    mp.defineInstance("useMultiByteEncoding", new Boolean( false ) );
    // Start the micro-platform
    mp.start();
    loginAsRepositoryAdmin();
    setAclManagement();
View Full Code Here

TOP

Related Classes of org.pentaho.platform.repository2.unified.jcr.IAclMetadataStrategy.AclMetadata

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.