mirror of
https://github.com/outline/outline.git
synced 2026-12-05 18:55:10 +03:00
15 lines
373 B
TypeScript
15 lines
373 B
TypeScript
import { Team, User, OAuthAuthentication } from "@server/models";
|
|
import { allow } from "./cancan";
|
|
import { isTeamModel } from "./utils";
|
|
|
|
allow(User, "listOAuthAuthentications", Team, (actor, team) =>
|
|
isTeamModel(actor, team)
|
|
);
|
|
|
|
allow(
|
|
User,
|
|
["read", "delete"],
|
|
OAuthAuthentication,
|
|
(actor, oauthAuthentication) => actor?.id === oauthAuthentication?.userId
|
|
);
|