mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
Documents can now have owners, stored as an array of user IDs. Owners must be active members or admins, and changing them requires the existing manage users permission on the document, gated behind a new DocumentOwners plan entitlement that is included in every plan. - ownerIds accepted by documents.create and documents.update and returned by the document presenter - ownerIds filter field (eq/in) for documents.list and documents.search - ownerIds on the MCP create_document and update_document tools, and an ownerId filter on list_documents - Owners section in the document Insights dialog to add and remove owners - Owner filter on the search page - In-app and email notification when a user is made an owner Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016MJXFdSZ39ZGPf31jyGcYz
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { Plan, PlanFeature } from "../types";
|
|
import { PlanHelper } from "./PlanHelper";
|
|
|
|
describe("PlanHelper", () => {
|
|
it("should define features for every plan", () => {
|
|
for (const plan of Object.values(Plan)) {
|
|
expect(PlanHelper.features[plan]).toBeDefined();
|
|
}
|
|
});
|
|
|
|
it("should not offer the legacy plan", () => {
|
|
expect(PlanHelper.plans).not.toContain(Plan.Legacy);
|
|
});
|
|
|
|
it("should check if a plan has a feature", () => {
|
|
expect(PlanHelper.hasFeature(Plan.Community, PlanFeature.AuditLog)).toBe(
|
|
false
|
|
);
|
|
expect(PlanHelper.hasFeature(Plan.Business, PlanFeature.AuditLog)).toBe(
|
|
true
|
|
);
|
|
});
|
|
|
|
it("should include document owners in every plan", () => {
|
|
for (const plan of Object.values(Plan)) {
|
|
expect(PlanHelper.hasFeature(plan, PlanFeature.DocumentOwners)).toBe(
|
|
true
|
|
);
|
|
}
|
|
});
|
|
|
|
it("should return the lowest plan with a feature", () => {
|
|
expect(PlanHelper.getMinimumPlan(PlanFeature.AuditLog)).toBe(Plan.Business);
|
|
});
|
|
});
|