Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.IAclHolder


  public void setPermissions( final Map<IPermissionRecipient, IPermissionMask> permissionsMap, final Object object ) {
    if ( object == null || !( object instanceof IAclHolder ) ) {
      // i would argue that the "object" parameter should be IAclHolder!
      return;
    }
    IAclHolder aclHolder = (IAclHolder) object;
    Set<Map.Entry<IPermissionRecipient, IPermissionMask>> mapEntrySet = permissionsMap.entrySet();
    ArrayList<IPentahoAclEntry> aclList = new ArrayList<IPentahoAclEntry>();
    for ( Entry<IPermissionRecipient, IPermissionMask> mapEntry : mapEntrySet ) {
      PentahoAclEntry pentahoAclEntry = new PentahoAclEntry();
      IPermissionRecipient permissionRecipient = mapEntry.getKey();
      if ( permissionRecipient instanceof SimpleRole ) {
        pentahoAclEntry.setRecipient( new GrantedAuthorityImpl( permissionRecipient.getName() ) );
      } else {
        pentahoAclEntry.setRecipient( permissionRecipient.getName() );
      }
      pentahoAclEntry.addPermission( mapEntry.getValue().getMask() );
      aclList.add( pentahoAclEntry );
    }
    // HibernateUtil.beginTransaction(); - This is now handled in the RepositoryFile
    aclHolder.resetAccessControls( aclList );
    // HibernateUtil.commitTransaction(); - This is covered by the exitPoint
  }
View Full Code Here


  public static SpringSecurityPermissionMgr instance() {
    return SpringSecurityPermissionMgr.singletonPermMgr;
  }

  public Map<IPermissionRecipient, IPermissionMask> getPermissions( final Object domainInstance ) {
    IAclHolder aclHolder = (IAclHolder) domainInstance;
    List<IPentahoAclEntry> aclList = aclHolder.getAccessControls();
    return transformEntries( aclList );
  }
View Full Code Here

    List<IPentahoAclEntry> aclList = aclHolder.getAccessControls();
    return transformEntries( aclList );
  }

  public Map<IPermissionRecipient, IPermissionMask> getEffectivePermissions( Object domainInstance ) {
    IAclHolder aclHolder = (IAclHolder) domainInstance;
    List<IPentahoAclEntry> aclList = aclHolder.getEffectiveAccessControls();
    return transformEntries( aclList );
  }
View Full Code Here

      final Object object ) {
    if ( object == null || !( object instanceof IAclHolder ) ) {
      // i would argue that the "object" parameter should be IAclHolder!
      return;
    }
    IAclHolder aclHolder = (IAclHolder) object;
    PentahoAclEntry entry = new PentahoAclEntry();
    // TODO mlowery instanceof is undesirable as it doesn't allow new concrete classes.
    if ( permissionRecipient instanceof SimpleRole ) {
      entry.setRecipient( new GrantedAuthorityImpl( permissionRecipient.getName() ) );
    } else {
      entry.setRecipient( permissionRecipient.getName() );
    }
    entry.addPermission( permission.getMask() );
    // HibernateUtil.beginTransaction(); - This is now handled by the RepositoryFile
    aclHolder.getAccessControls().add( entry );
    // HibernateUtil.commitTransaction(); - This should be covered by the exitPoint call
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.IAclHolder

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.