mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
fix: Default collections created through MCP to private (#12644)
This commit is contained in:
@@ -1241,6 +1241,7 @@ describe("#collections.create", () => {
|
||||
expect(body.data.name).toBe("Test");
|
||||
expect(body.data.sort.field).toBe("index");
|
||||
expect(body.data.sort.direction).toBe("asc");
|
||||
expect(body.data.permission).toBe(null);
|
||||
expect(body.policies.length).toBe(1);
|
||||
expect(body.policies[0].abilities.read).toBeTruthy();
|
||||
});
|
||||
|
||||
@@ -60,6 +60,7 @@ describe("collection tools", () => {
|
||||
expect(data.color).toEqual("#FF0000");
|
||||
expect(data.id).toBeDefined();
|
||||
expect(data.url).toMatch(/^https?:\/\//);
|
||||
expect(data.permission).toEqual(null);
|
||||
});
|
||||
|
||||
it("update_collection updates fields on existing collection", async () => {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { z } from "zod";
|
||||
import { Sequelize, Op, type WhereOptions } from "sequelize";
|
||||
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||
import { CollectionPermission } from "@shared/types";
|
||||
import { Collection, Team } from "@server/models";
|
||||
import { sequelize } from "@server/storage/database";
|
||||
import { authorize } from "@server/policies";
|
||||
@@ -179,7 +178,7 @@ export function collectionTools(server: McpServer, scopes: string[]) {
|
||||
color: input.color,
|
||||
teamId: user.teamId,
|
||||
createdById: user.id,
|
||||
permission: CollectionPermission.ReadWrite,
|
||||
permission: null,
|
||||
});
|
||||
|
||||
await collection.saveWithCtx(ctx);
|
||||
|
||||
Reference in New Issue
Block a user