refactor: documents.batchImport -> collections.import

This commit is contained in:
Tom Moor
2020-12-28 18:51:12 -08:00
parent d79933887d
commit caee7afde2
10 changed files with 72 additions and 72 deletions

View File

@ -1,6 +1,5 @@
// @flow
import invariant from "invariant";
import { AdminRequiredError } from "../errors";
import { Document, Revision, User } from "../models";
import policy from "./policy";
@ -8,11 +7,6 @@ const { allow, cannot } = policy;
allow(User, "create", Document);
allow(User, "batchImport", Document, (actor) => {
if (actor.isAdmin) return true;
throw new AdminRequiredError();
});
allow(User, ["read", "download"], Document, (user, document) => {
// existence of collection option is not required here to account for share tokens
if (document.collection && cannot(user, "read", document.collection)) {