mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
20 lines
396 B
TypeScript
20 lines
396 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)
|
|
)
|
|
);
|
|
|
|
allow(User, "delete", Revision, (actor) =>
|
|
and(
|
|
//
|
|
actor.isAdmin,
|
|
isTeamMutable(actor)
|
|
)
|
|
);
|