Interface SpaceDocumentsExposureStorage


public interface SpaceDocumentsExposureStorage
Reads what a space's documents expose outside the space, and takes the everyone entry off a document's own access list. Every method reads and writes through a system session, whatever the caller's permissions: the caller checks, before it calls, that the user may manage the space.
  • Method Summary

    Modifier and Type
    Method
    Description
    getSharedOutsideDocuments(org.exoplatform.social.core.space.model.Space space, Predicate<String> isMember, Set<String> everyoneIgnored)
    Lists the documents and folders of the space, in its drive or trashed or quarantined from it, whose own access list holds at least one entry outside the space.
    getSpaceDocuments(org.exoplatform.social.core.space.model.Space space, Collection<String> documentIds)
    Keeps, among documents, those that still exist and belong to the space: stored in its drive, or trashed or quarantined from it.
    prepareLinkRemoval(org.exoplatform.social.core.space.model.Space space, String documentId, boolean removeEveryone)
    Reads a document again through a fresh system session before its public link is removed and, when asked, takes the everyone entry off its own access list through its permission API; a document with no access list of its own has none to take off.
  • Method Details

    • getSpaceDocuments

      List<ExposedDocument> getSpaceDocuments(org.exoplatform.social.core.space.model.Space space, Collection<String> documentIds)
      Keeps, among documents, those that still exist and belong to the space: stored in its drive, or trashed or quarantined from it. A document that points to an item that no longer exists (a shortcut's target, a version's document) belongs to the space when its own stored path lies in the space's drive.
      Parameters:
      space - a space
      documentIds - document identifiers
      Returns:
      the documents of the space, in the order of documentIds
      Throws:
      IllegalStateException - when a document cannot be read or its space cannot be resolved
    • getSharedOutsideDocuments

      List<ExposedDocument> getSharedOutsideDocuments(org.exoplatform.social.core.space.model.Space space, Predicate<String> isMember, Set<String> everyoneIgnored)
      Lists the documents and folders of the space, in its drive or trashed or quarantined from it, whose own access list holds at least one entry outside the space. A folder's children that inherit its access list are not listed; shortcuts are not listed. An entry's place is decided by SpaceAccessClassifier, with the identities of the access list of the space's drive root.
      Parameters:
      space - a space
      isMember - tells whether a user is a member of the space, from the source the caller's decision reads
      everyoneIgnored - identifiers of documents whose own everyone entry is not counted, the others of their access list still being: those the caller is about to take it off
      Returns:
      the documents shared outside the space, in no particular order
      Throws:
      IllegalStateException - when the documents cannot be read
    • prepareLinkRemoval

      ExposedDocument prepareLinkRemoval(org.exoplatform.social.core.space.model.Space space, String documentId, boolean removeEveryone)
      Reads a document again through a fresh system session before its public link is removed and, when asked, takes the everyone entry off its own access list through its permission API; a document with no access list of its own has none to take off.
      Parameters:
      space - the space the document must still belong to
      documentId - the document's identifier
      removeEveryone - whether to take the everyone entry off the document's own access list
      Returns:
      the document, or null when it no longer exists or no longer belongs to the space: then nothing was changed. A move committed after this read is not seen by the caller's next step.
      Throws:
      IllegalStateException - when the document cannot be read or written