Esempio n. 1
0
  public Acl applyAcl(
      CallContext context,
      String repositoryId,
      String objectId,
      Acl addAces,
      Acl removeAces,
      AclPropagation aclPropagation,
      ExtensionsData extension,
      ObjectInfoHandler objectInfos) {

    addAces = TypeValidator.expandAclMakros(context.getUsername(), addAces);
    removeAces = TypeValidator.expandAclMakros(context.getUsername(), removeAces);

    StoredObject so =
        validator.applyAcl(context, repositoryId, objectId, aclPropagation, extension);
    Acl acl =
        fStoreManager
            .getObjectStore(repositoryId)
            .applyAcl(so, addAces, removeAces, aclPropagation, context.getUsername());

    if (context.isObjectInfoRequired()) {
      ObjectInfoImpl objectInfo = new ObjectInfoImpl();
      fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
      objectInfos.addObjectInfo(objectInfo);
    }
    return acl;
  }
  public ObjectData build(
      CallContext context,
      Record record,
      Set<String> filter,
      boolean includeAllowableActions,
      boolean includeAcl,
      ObjectInfoHandler objectInfos) {
    ObjectDataImpl result = new ObjectDataImpl();
    ObjectInfoImpl objectInfo = new ObjectInfoImpl();

    result.setProperties(compileProperties(record, filter, objectInfo));

    if (includeAllowableActions) {
      result.setAllowableActions(new AllowableActionsBuilder(repository, record).build());
    }

    //		if (includeAcl) {
    //			result.setAcl(new AclBuilder(repository).build(file));
    //			result.setIsExactAcl(true);
    //		}

    if (context.isObjectInfoRequired()) {
      objectInfo.setObject(result);
      objectInfos.addObjectInfo(objectInfo);
    }

    return result;
  }
Esempio n. 3
0
  public Acl getAcl(
      CallContext context,
      String repositoryId,
      String objectId,
      Boolean onlyBasicPermissions,
      ExtensionsData extension,
      ObjectInfoHandler objectInfos) {
    LOG.debug("start getAcl()");
    Acl acl = null;
    StoredObject so = validator.getAcl(context, repositoryId, objectId, extension);
    if (so instanceof DocumentVersion) acl = ((DocumentVersion) so).getParentDocument().getAcl();
    else acl = so.getAcl();

    if (context.isObjectInfoRequired()) {
      ObjectInfoImpl objectInfo = new ObjectInfoImpl();
      fAtomLinkProvider.fillInformationForAtomLinks(repositoryId, so, objectInfo);
      objectInfos.addObjectInfo(objectInfo);
    }

    return acl;
  }