Collection

org.llm4s.rag.permissions.Collection
final case class Collection(id: Int, path: CollectionPath, parentPath: Option[CollectionPath], queryableBy: Set[PrincipalId], isLeaf: Boolean, metadata: Map[String, String])

A collection in the search index hierarchy.

Collections organize documents and define access permissions. They form a tree structure where:

  • Parent collections can have their own queryable_by permissions
  • Sub-collections inherit parent permissions and can add further restrictions
  • Documents can only be added to leaf collections

Value parameters

id

Database primary key

isLeaf

True if this is a leaf collection (can contain documents)

metadata

Optional key-value metadata for the collection

parentPath

The parent collection path, if not a root collection

path

The unique collection path (e.g., "confluence/EN")

queryableBy

Set of principal IDs that can query this collection (empty = public)

Attributes

Source
Collection.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Check if a user with the given authorization can query this collection.

Check if a user with the given authorization can query this collection.

A user can query if:

  • The collection is public (empty queryableBy), OR
  • The user is an admin, OR
  • The user's principal IDs overlap with the collection's queryableBy set

Attributes

Source
Collection.scala
def depth: Int

The depth of this collection in the hierarchy (1 for root)

The depth of this collection in the hierarchy (1 for root)

Attributes

Source
Collection.scala

True if this collection is public (queryable by anyone)

True if this collection is public (queryable by anyone)

Attributes

Source
Collection.scala

True if this is a root collection (no parent)

True if this is a root collection (no parent)

Attributes

Source
Collection.scala
def name: String

The collection name (final path segment)

The collection name (final path segment)

Attributes

Source
Collection.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product