Move Knowledge Constants and Fix Inverted Ownership Filters
- Add XAiKnowledgeScope enum (Conversation=0, Project=1, Global=2, User=3) with StringValue prefixes; - Add Knowledge constants, scope prefixes, metadata keys and XAiErrorRoute to XAiModelsConstants; - Fix inverted ownerId condition in QueryProjects / QueryConversations / QueryMessages (ownership filter was skipped for real owners -> cross-user data exposure); - Fix inverted HasChild() validation in HasDefaultProject / HasDefaultConversation; - LoadConversations: ignore soft-deleted conversations; - CreateProject / CreateConversation: set isDefaultLanguageHandled = true; - GetDefaultConversation: use projectId instead of unloaded project.Id.
This commit is contained in:
@@ -267,7 +267,7 @@ namespace xAiModels.Extensions
|
||||
{
|
||||
//
|
||||
// Validate Args ...
|
||||
if (source.HasChild() ||
|
||||
if (!source.HasChild() ||
|
||||
ownerId.IsNullOrEmpty())
|
||||
{
|
||||
XException.InvalidArgs.Throw();
|
||||
@@ -306,7 +306,7 @@ namespace xAiModels.Extensions
|
||||
{
|
||||
//
|
||||
// Validate Args ...
|
||||
if (source.HasChild() ||
|
||||
if (!source.HasChild() ||
|
||||
projectId.IsDefaultGuid())
|
||||
{
|
||||
XException.InvalidArgs.Throw();
|
||||
|
||||
Reference in New Issue
Block a user