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 TypeMethodDescriptiongetSharedOutsideDocuments(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 spacedocumentIds- 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
-
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 todocumentId- the document's identifierremoveEveryone- 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
-