mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
* fix: Flaky test * Migration, model interface * Add policies to revisions * Add revisions.update endpoint * tests * lint
12 lines
289 B
TypeScript
12 lines
289 B
TypeScript
import { User, Revision } from "@server/models";
|
|
import { allow } from "./cancan";
|
|
import { and, isTeamMutable, or } from "./utils";
|
|
|
|
allow(User, ["update"], Revision, (actor, revision) =>
|
|
and(
|
|
//
|
|
or(actor.id === revision?.userId, actor.isAdmin),
|
|
isTeamMutable(actor)
|
|
)
|
|
);
|