org.llm4s.rag.permissions
Members list
Packages
Type members
Classlikes
A chunk with its embedding ready for indexing.
A chunk with its embedding ready for indexing.
Value parameters
- chunkIndex
-
The index of this chunk within the document
- content
-
The text content of the chunk
- embedding
-
The vector embedding
- metadata
-
Additional metadata for this chunk
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A collection in the search index hierarchy.
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
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Configuration for creating a new collection.
Configuration for creating a new collection.
Value parameters
- isLeaf
-
True if this is a leaf collection (can contain documents)
- metadata
-
Optional key-value metadata for the collection
- path
-
The collection path to create
- queryableBy
-
Set of principal IDs that can query this collection (empty = public)
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
CollectionConfig.type
A validated collection path in the hierarchy.
A validated collection path in the hierarchy.
Collection paths use forward-slash separators (e.g., "confluence/EN/archive"). Each segment must contain only alphanumeric characters, underscores, and hyphens.
Value parameters
- segments
-
The path segments (e.g., Seq("confluence", "EN", "archive"))
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
CollectionPath.type
A pattern for matching collections in queries.
A pattern for matching collections in queries.
Patterns support:
- Exact matching:
confluence/EN - Immediate children:
confluence/★(matchesconfluence/ENbut notconfluence/EN/archive) - All descendants:
confluence/★★(matches all paths starting withconfluence/) - All collections:
★
Note: In code, use asterisk (*) instead of ★ shown in docs.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
CollectionPattern.type
Statistics for a collection.
Statistics for a collection.
Value parameters
- chunkCount
-
Total number of chunks across all documents
- documentCount
-
Number of unique documents in the collection
- subCollectionCount
-
Number of direct sub-collections
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Storage for collections with permission management.
Storage for collections with permission management.
Manages the hierarchical collection structure and enforces permission inheritance rules:
- SubCollections inherit parent permissions
- SubCollections can only add restrictions (never loosen)
- Documents can only be added to leaf collections
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class PgCollectionStore
External principal identifier before resolution to internal ID.
External principal identifier before resolution to internal ID.
External IDs are human-readable identifiers like email addresses or group names that get mapped to integer IDs for efficient storage.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- trait
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
ExternalPrincipal.type
Type-safe wrapper for principal IDs.
Type-safe wrapper for principal IDs.
Uses integer representation for efficient database queries:
- Positive integers represent users
- Negative integers represent groups
- Zero is reserved (not used)
Value parameters
- value
-
The integer ID (positive=user, negative=group)
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass AnyValtrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PrincipalId.type
Storage for principal ID mappings.
Storage for principal ID mappings.
Maps external identifiers (email addresses, group names) to internal integer IDs that are efficient for database queries.
Design:
- User IDs are positive integers (auto-incremented from SERIAL)
- Group IDs are negative integers (from a separate sequence)
- External IDs are prefixed with type: "user:john@example.com", "group:admins"
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class PgPrincipalStore
Top-level search index with permission-based filtering.
Top-level search index with permission-based filtering.
SearchIndex is the main entry point for permission-aware RAG operations. It combines:
- Collection hierarchy management
- User/group principal mapping
- Permission-filtered vector search
- Document ingestion with access control
Query flow:
- Resolve accessible collection IDs based on pattern + user authorization
- Perform vector search within those collections
- Apply document-level permission filtering (readable_by)
- Return permission-filtered results
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class PgSearchIndex
Factory for creating SearchIndex instances.
Factory for creating SearchIndex instances.
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
SearchIndex.type
User authorization context for permission-filtered queries.
User authorization context for permission-filtered queries.
Contains the set of principal IDs (user + groups) that the current user belongs to, which is used to filter collections and documents.
Value parameters
- isAdmin
-
True if this user has admin privileges (bypasses permission checks)
- principalIds
-
The set of principal IDs for this user (includes user ID and all group IDs)
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
UserAuthorization.type